11[ English document] ( api_en.md )
22
33* [ Common API] ( #common-api )
4+ * [ initPush] ( #initpush )
45 * [ getRegistrationID] ( #getregistrationid )
56 * [ stopPush] ( #stoppush )
67 * [ resumePush] ( #resumepush )
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 )
3737 * [ addGetRegistrationIdListener] ( #addgetregistrationIdlistener )
3838 * [ removeGetRegistrationIdListener] ( #removegetregistrationidlistener )
3939
40- 注意: 在 Android 需要先调用 ` initPush ` 方法, iOS 端不需要 。
40+ 注意: 需要调用先调用 ` initPush ` 方法才能正常使用 。
4141
4242### Common API
4343
4444Android 和 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。
6175JPushModule.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