Skip to content

Commit 1285425

Browse files
author
wicked-tc130
authored
更新README.md
1 parent 821d811 commit 1285425

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# JPush-React-Native
2+
3+
## 1. 安装
4+
5+
```
6+
npm install jpush-react-native --save
7+
```
8+
9+
* 注意:如果项目里没有jcore-react-native,需要安装
10+
11+
```
12+
npm install jcore-react-native --save
13+
```
14+
15+
## 2. 配置
16+
17+
### 2.1 Android
18+
19+
* build.gradle
20+
21+
```
22+
android {
23+
defaultConfig {
24+
applicationId "yourApplicationId" //在此替换你的应用包名
25+
...
26+
manifestPlaceholders = [
27+
JPUSH_APPKEY: "yourAppKey", //在此替换你的APPKey
28+
JPUSH_CHANNEL: "yourChannel" //在此替换你的channel
29+
]
30+
}
31+
}
32+
```
33+
34+
```
35+
dependencies {
36+
...
37+
implementation project(':jpush-react-native') // 添加 jpush 依赖
38+
implementation project(':jcore-react-native') // 添加 jcore 依赖
39+
}
40+
```
41+
42+
* AndridManifest.xml
43+
44+
```
45+
<meta-data
46+
android:name="JPUSH_CHANNEL"
47+
android:value="${JPUSH_CHANNEL}" />
48+
<meta-data
49+
android:name="JPUSH_APPKEY"
50+
android:value="${JPUSH_APPKEY}" />
51+
```
52+
53+
* setting.gradle
54+
55+
```
56+
include ':jpush-react-native'
57+
project(':jpush-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jpush-react-native/android')
58+
include ':jcore-react-native'
59+
project(':jcore-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jcore-react-native/android')
60+
```
61+
62+
###2.2 iOS

0 commit comments

Comments
 (0)