Skip to content

Commit 218a4b8

Browse files
committed
Update DOC
1 parent 264cf61 commit 218a4b8

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ react-native link
2626
-framework "account_verify_sdk_core"
2727
```
2828

29+
#### Android
30+
31+
- [Checkout settings.gradle and build.gradle](./docs/AndroidConfig.md)
32+
33+
- [Add JVerificationPackage, don't forget parameters!](./docs/JVerificationPackage.md)
34+
2935
## API
3036

3137
#### Usage:

docs/AndroidConfig.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Android Configure Part
2+
3+
## Checkout settings.gradle
4+
5+
> your project/android/settings.gradle
6+
7+
```
8+
include ':app', 'jverification-react-native, 'jcore-react-native'
9+
project(':jverification-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jverification-react-native/android')
10+
project(':jcore-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jcore-react-native/android')
11+
```
12+
13+
## Checkout module's build.gradle, add configuration
14+
15+
> your project/android/app/build.gradle
16+
17+
```
18+
android {
19+
...
20+
defaultConfig {
21+
applicationId "your application id"
22+
...
23+
manifestPlaceholders = [
24+
JPUSH_APPKEY: "your app key", //在此替换你的APPKey
25+
JPUSH_CHANNEL: "developer-default", //应用渠道号, 默认即可
26+
]
27+
}
28+
}
29+
...
30+
dependencies {
31+
implementation project(':jverification-react-native')
32+
implementation project(':jcore-react-native')
33+
}
34+
```
35+
36+
37+
38+
39+
40+

docs/JVerificationPackage.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Add JVerificationPackage
2+
3+
> your project/android/app/src…/MainApplication.java
4+
5+
```
6+
// 需要 import JVerificationInterface 和 JVerificationPackage
7+
import cn.jiguang.verifysdk.api.JVerificationInterface;
8+
import cn.jpush.reactnativejvrification.JVerificationPackage;
9+
10+
public class MainApplication extends Application implements ReactApplication {
11+
12+
13+
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
14+
15+
@Override
16+
public boolean getUseDeveloperSupport() {
17+
return BuildConfig.DEBUG;
18+
}
19+
20+
21+
@Override
22+
protected List<ReactPackage> getPackages() {
23+
return Arrays.<ReactPackage>asList(
24+
new MainReactPackage(),
25+
new JVerificationPackage()
26+
);
27+
}
28+
};
29+
30+
@Override
31+
public ReactNativeHost getReactNativeHost() {
32+
return mReactNativeHost;
33+
}
34+
35+
@Override
36+
public void onCreate() {
37+
super.onCreate();
38+
SoLoader.init(this, false);
39+
// 在 Init 之前调用,设置为 true,则会打印 debug 级别日志,否则只会打印 warning 级别以上的日志
40+
// JVerificationInterface.setDebugMode(true);
41+
// SDK 初始化建议在这进行
42+
JVerificationInterface.init(this);
43+
}
44+
}
45+
```
46+
47+
48+
49+
50+

0 commit comments

Comments
 (0)