$ npm install react-native-mkepler --save
$ react-native link react-native-mkepler
- 打开XCode工程中, 右键点击
Libraries
➜Add Files to [your project's name]
- 去
node_modules
➜react-native-mkepler
目录添加RNReactNativeMkepler.xcodeproj
- 在工程
Build Phases
➜Link Binary With Libraries
中添加libRNReactNativeMkepler.a
- 打开
android/app/src/main/java/[...]/MainActivity.java
- 在顶部添加
import com.maochunjie.mkepler.RNReactNativeMkeplerPackage;
- 在
getPackages()
方法后添加new RNReactNativeMkeplerPackage()
- 打开
android/settings.gradle
,添加:include ':react-native-mkepler' project(':react-native-mkepler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mkepler/android')
- 打开
android/app/build.gradle
,添加:compile project(':react-native-mkepler')
- 将下载的开普勒iOS SDK引入到项目中
URL Schemes
添加sdkback + 开普勒appKey
LSApplicationQueriesSchemes
添加jdlogin
、openapp.jdmobile
- 需要按照步骤来【加入依赖库、关闭Bitcode、设置application openURL等】http://kepler.jd.com/console/docCenterCatalog/docContent?channelId=46
- 打开
android/app/build.gradle
,在defaultConfig
下添加:manifestPlaceholders = [ KeplerScheme : "xxxxxx" //开普勒SDK中AndroidManifest.xml 中的值 ]
- 复制开普勒SDK中的
safe.jpg
到android/app/src/main/res/raw/safe.jpg
- 配置混淆
-keep class com.kepler.**{*;}
-dontwarn com.kepler.**
-keep class com.jingdong.jdma.**{*;}
-dontwarn com.jingdong.jdma.**
import * as mKepler from 'react-native-mkepler';
// TODO: What to do with the module?