Skip to content

Commit a410a77

Browse files
author
詹强
committed
更新README.md
1 parent fc1f3ba commit a410a77

File tree

1 file changed

+81
-33
lines changed

1 file changed

+81
-33
lines changed

README.md

Lines changed: 81 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,103 @@ npm install jpush-react-native --save
88

99
* 注意:如果项目里没有jcore-react-native,需要安装
1010

11-
```
12-
npm install jcore-react-native --save
13-
```
11+
```
12+
npm install jcore-react-native --save
13+
```
1414

1515
## 2. 配置
1616

1717
### 2.1 Android
1818

1919
* build.gradle
2020

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-
```
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+
```
3333

34-
```
35-
dependencies {
36-
...
37-
implementation project(':jpush-react-native') // 添加 jpush 依赖
38-
implementation project(':jcore-react-native') // 添加 jcore 依赖
39-
}
40-
```
34+
```
35+
dependencies {
36+
...
37+
implementation project(':jpush-react-native') // 添加 jpush 依赖
38+
implementation project(':jcore-react-native') // 添加 jcore 依赖
39+
}
40+
```
4141

4242
* AndridManifest.xml
4343

44-
```
45-
<meta-data
46-
android:name="JPUSH_CHANNEL"
44+
```
45+
<meta-data
46+
android:name="JPUSH_CHANNEL"
4747
android:value="${JPUSH_CHANNEL}" />
48-
<meta-data
48+
<meta-data
4949
android:name="JPUSH_APPKEY"
5050
android:value="${JPUSH_APPKEY}" />
51-
```
51+
```
5252

5353
* setting.gradle
5454

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-
```
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+
```
6161

6262
###2.2 iOS
63+
64+
* Libraries
65+
66+
```
67+
Add Files to "your project name"
68+
node_modules/jcore-react-native/ios/RCTJCoreModule/
69+
node_modules/jpush-react-native/ios/RCTJPushModule/
70+
```
71+
72+
* Capabilities
73+
74+
```
75+
Push Notification --- ON
76+
```
77+
78+
* Build Settings
79+
80+
```
81+
All --- Search Paths --- Header Search Paths --- +
82+
$(SRCROOT)/../node_modules/jcore-react-native/ios/RCTJCoreModule/
83+
$(SRCROOT)/../node_modules/jpush-react-native/ios/RCTJPushModule/
84+
```
85+
86+
* Build Phases
87+
88+
```
89+
libz.tbd
90+
libresolv.tbd
91+
UserNotifications.framework
92+
93+
```
94+
95+
## 3. 引用
96+
97+
### 3.1 Android
98+
99+
参考:[MainApplication.java](https://github.com/jpush/jpush-react-native/tree/master/example/android/app/src/main/java/com/example/MainApplication)
100+
101+
### 3.2 iOS
102+
103+
参考:[AppDelegate.m](https://github.com/jpush/jpush-react-native/tree/master/example/ios/PushDemo/AppDelegate.m)
104+
105+
## 4. API
106+
107+
详见:[index.js](https://github.com/jpush/jpush-react-native/blob/master/index.js)
108+
109+
110+

0 commit comments

Comments
 (0)