npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

maxleap-react-native

v0.0.16

Published

MaxLeap SDK for ReactNative

Downloads

16

Readme

MaxLeap SDK RN npm version

安装 SDK

npm install --save maxleap-react-native

集成 iOS 环境

  1. 打开 Finder, 导航到当前项目根目录,进入 node_modules/maxleap-react-native/ios/lib 文件夹,把这个文件夹下的 frameworks 都添加到 Xcode 工程中。

  2. 在弹出的对话框中的 Added folders 选项上选择 Create groups,点击 Finish

  3. 添加依赖 确保“Enable Modules (C and Objective-C)” 和 “Link Frameworks Automatically”的生成设置为 Yes。

    点击 Targets → YourAppName → "Build Phases" 栏。 展开 “Link Binary With Libraries”

    点击 "Link Binary With Libraries" 左下角+号按钮,添加下列框架:

    MobileCoreServices.framework CoreTelephony.framework SystemConfiguration.framework libsqlite3.dylib libz.dylib

  4. 添加 Framework Search Paths

    在 Xcode 中,导航到 Targets -> YourAppName -> "Build Settings",找到 “Framework Search Paths” 一项,添加下面这个路径:

    $(SRCROOT)/../node_modules/maxleap-react-native/ios/lib

  5. 修改 AppDelegate.m 文件

    加入以下代码:

    #import <MaxLeap/MaxLeap.h>
       
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
       
        [MaxLeap setApplicationId:@"your_maxleap_appId" 
                      clientKey:@"your_maxleap_clientKey"
      					 	   site:MLSiteCN];
      	// your code ...
    }

集成 Android 环境

  1. 修改父工程目录下的 build.gradle 文件(与 settings.gradle 位于同级目录)。

    repositories {
        flatDir{
            dirs '../../node_modules/maxleap-react-native/dist/android'
        }
    }
  2. 修改应用目录下的 build.gradle 文件,添加以下依赖

    dependencies {
        compile(name:'maxleap-react-native', ext:'aar')
    }
  3. 修改工程的主 Activity 文件。

    private MaxLeap maxLeap;
    
     @Override
    protected void onCreate(Bundle savedInstanceState) {
        // 确保在 super.onCreate() 之前调用以下代码
        maxLeap = new MaxLeap(this, APP_ID, API_KEY);
        super.onCreate(savedInstanceState);
    }
    
    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
                new MainReactPackage(),
                maxLeap.getReactPackage()
        );
    }

使用 SDK

import ML from 'maxleap-react-native';
ML.useCNServer();

详细使用方法请参阅 MaxLeap 文档