Package Exports
- maxleap-react-native
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (maxleap-react-native) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
MaxLeap-SDK
安装 SDK
npm install --save maxleap-react-native集成 iOS 环境
将当前目录下的
node_modules/maxleap-react-native/ios/lib文件夹整个拖到工程的Libraries目录下。在弹出的对话框中的
Added folders选项上选择Create groups,点击Finish。修改
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 环境
修改父工程目录下的
build.gradle文件(与settings.gradle位于同级目录)。repositories { flatDir{ dirs '../../node_modules/maxleap-react-native/dist/android' } }修改应用目录下的
build.gradle文件,添加以下依赖dependencies { compile(name:'maxleap-react-native', ext:'aar') }修改工程的主 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() ); }