Skip to content

Commit 58119f1

Browse files
committed
update docs
1 parent d9dfffe commit 58119f1

File tree

3 files changed

+50
-35
lines changed

3 files changed

+50
-35
lines changed

example/documents/iOS_API.md

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,50 @@ All apis can find in jpush-react-native/index.js.
44

55
- setBadge(Int, Function)
66

7-
设置 badge 值
8-
```javascript
9-
JPushModule.setBadge(5, (success) => {
10-
console.log(success)
11-
});
12-
```
7+
设置 badge 值
8+
9+
```
10+
JPushModule.setBadge(5, (success) => {
11+
console.log(success)
12+
});
13+
```
14+
15+
16+
17+
- getBadge
18+
19+
获取 badge 值
20+
21+
```javascript
22+
JPushModule.getBadge((badge) => {
23+
console.log(badge)
24+
});
25+
```
26+
27+
28+
1329
- setLocalNotification
14-
```javascript
15-
setLocalNotification( Date, // date 触发本地推送的时间
16-
textContain, // String 推送消息体内容
17-
badge, // int 本地推送触发后 应用 Badge(小红点)显示的数字
18-
alertAction, // String 弹框的按钮显示的内容(IOS 8默认为"打开", 其他默认为"启动")
19-
notificationKey, // String 本地推送标示符
20-
userInfo, // Object 推送的附加字段 (任意键值对)
21-
soundName // String 自定义通知声音,设置为 null 为默认声音
22-
)
23-
24-
设置本地推送
25-
```
26-
```javascript
27-
JPushModule.setLocalNotification( this.state.date,
28-
this.state.textContain,
29-
5,
30-
'Action',
31-
'notificationIdentify',
32-
{myInfo: ""},
33-
null);
34-
```
30+
```javascript
31+
setLocalNotification( Date, // date 触发本地推送的时间
32+
textContain, // String 推送消息体内容
33+
badge, // int 本地推送触发后 应用 Badge(小红点)显示的数字
34+
alertAction, // String 弹框的按钮显示的内容(IOS 8默认为"打开", 其他默认为"启动")
35+
notificationKey, // String 本地推送标示符
36+
userInfo, // Object 推送的附加字段 (任意键值对)
37+
soundName // String 自定义通知声音,设置为 null 为默认声音
38+
)
39+
40+
设置本地推送
41+
```
42+
```javascript
43+
JPushModule.setLocalNotification( this.state.date,
44+
this.state.textContain,
45+
5,
46+
'Action',
47+
'notificationIdentify',
48+
{myInfo: ""},
49+
null);
50+
```
3551

3652
## 事件
3753
**点击推送启动应用事件**
@@ -40,17 +56,16 @@ setLocalNotification( Date, // date 触发本地推送的时间
4056

4157
监听:应用没有启动的状态点击推送打开应用
4258

43-
```javascript
44-
JPushModule.addOpenNotificationLaunchAppListener( (notification) => {
45-
46-
})
47-
```
59+
```javascript
60+
JPushModule.addOpenNotificationLaunchAppListener( (notification) => {
61+
62+
})
63+
```
4864

4965
- removeOpenNotificationLaunchAppListener(Function)
5066

5167
取消监听:应用没有启动的状态点击推送打开应用,和 `addOpenNotificationLaunchAppListener` 成对使用
5268

53-
5469

5570
**登录事件**
5671

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ export default class JPush {
515515
* iOS Only
516516
* @param {Function} cb = (int) => { } // 返回应用 icon badge。
517517
*/
518-
static getApplicationIconBadge(cb) {
518+
static getBadge(cb) {
519519
JPushModule.getApplicationIconBadge((badge) => {
520520
cb(badge);
521521
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jpush-react-native",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "a jpush plugin for react native application",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)