Skip to content

Commit 6b464eb

Browse files
committed
update api
1 parent 15d09a6 commit 6b464eb

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

documents/api.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[English document](api_en.md)
22

33
* [Common API](#common-api)
4+
* [initPush](#initpush)
45
* [getRegistrationID](#getregistrationid)
56
* [stopPush](#stoppush)
67
* [resumePush](#resumepush)
@@ -24,7 +25,6 @@
2425
* [点击推送启动应用事件](#open-notification-launch-app-event)
2526
* [网络成功登陆事件](#network-did-login-event)
2627
* [Android Only API](#android-only-api)
27-
* [initPush](#initpush)
2828
* [crashLogOFF](#crashlogoff)
2929
* [crashLogON](#crashlogno)
3030
* [notifyJSDidLoad](#notifyjsdidload)
@@ -37,12 +37,26 @@
3737
* [addGetRegistrationIdListener](#addgetregistrationIdlistener)
3838
* [removeGetRegistrationIdListener](#removegetregistrationidlistener)
3939

40-
注意: 在 Android 需要先调用 `initPush` 方法, iOS 端不需要
40+
注意: 需要调用先调用 `initPush` 方法才能正常使用
4141

4242
### Common API
4343

4444
Android 和 iOS 通用 API。
4545

46+
#### initPush
47+
48+
初始化 JPush,这个方法初始化推送功能 iOS 会弹出获取推送权限的提示框(注意这个系统提示框只会触发一次,如果用户首次不同意,之后需要用户到设置中修改推送权限)。
49+
50+
```
51+
JPushModule.initPush()
52+
```
53+
54+
Android 建议在原生 `MainActivity``onCreate` 中调用:
55+
56+
```
57+
// java 原生代码
58+
JPushInterface.init(this);
59+
```
4660
#### getRegistrationID
4761

4862
* getRegistrationID(function)
@@ -61,20 +75,19 @@ Android 和 iOS 通用 API。
6175
JPushModule.stopPush();
6276
```
6377

64-
* #### resumePush
78+
#### resumePush
6579

66-
恢复推送。建议在 `MainActivity``onResume` 中调用:
80+
恢复推送。建议在 `MainActivity``onResume` 中调用:
6781

68-
```
69-
// android native java
70-
JPushInterface.onResume(this);
71-
```
72-
73-
```
74-
// iOS - javascirpt
75-
JPushModule.resumePush();
76-
```
82+
```
83+
// android native java
84+
JPushInterface.onResume(this);
85+
```
7786

87+
```
88+
// iOS - javascirpt
89+
JPushModule.resumePush();
90+
```
7891
#### setAlias
7992

8093
* setAlias(alias, successCallback)
@@ -365,13 +378,6 @@ JPushModule.getLaunchAppNotification( notification => {
365378

366379
### Android Only API
367380

368-
* #### initPush
369-
370-
初始化 JPush。建议在 `MainActivity``onCreate` 中调用:
371-
372-
```
373-
JPushInterface.init(this);
374-
```
375381

376382
* #### crashLogOFF
377383

0 commit comments

Comments
 (0)