22
33- [ Common API] ( #common-api )
44 - [ getRegistrationID] ( #getregistrationid )
5+ - [ stopPush] ( #stoppush )
56 - [ setAlias] ( #setalias )
67 - [ addTags] ( #addtags )
78 - [ setTags] ( #settags )
1112 - [ Receive Notification event] ( #receive-notification-event )
1213 - [ Receive Custom Message Event] ( #receive-custom-message-event )
1314 - [ sendLocalNotification] ( #sendlocalnotification )
15+ - [ clearAllNotifications] ( #clearallnotifications )
16+ - [ clearNotificationById] ( #clearnotificationbyId )
1417- [ iOS Only API] ( #ios-only-api )
1518 - [ setBadge] ( #setbadge )
1619 - [ getBadge] ( #getbadge )
1922 - [ Network Did Login Event] ( #network-did-login-event )
2023- [ Android Only API] ( #android-only-api )
2124 - [ initPush] ( #initpush )
22- - [ stopPush] ( #stoppush )
2325 - [ resumePush] ( #resumepush )
2426 - [ crashLogOFF] ( #crashlogoff )
2527 - [ crashLogON] ( #crashlogon )
2628 - [ notifyJSDidLoad] ( #notifyjsdidload )
27- - [ clearAllNotifications] ( #clearallnotifications )
28- - [ clearNotificationById] ( #clearnotificationbyId )
2929 - [ getInfo] ( #getInfo )
3030 - [ setStyleBasic] ( #setstylebasic )
3131 - [ setStyleCustom] ( #setstylecustom )
@@ -50,6 +50,15 @@ registrationId generated by JPush SDK according to deviceToken .
5050 JPushModule .getRegistrationID ((registrationId ) => {})
5151 ```
5252
53+
54+ #### stopPush
55+
56+ Stop push.
57+
58+ ```
59+ JPushModule.stopPush();
60+ ```
61+
5362#### setAlias
5463
5564set device's application alias, you can push notificaiton with alias, every device can only have one alias.
@@ -102,9 +111,9 @@ reset tags.
102111- sendLocalNotification(notification)
103112
104113 - ** buildId** : Number // set local notification styles,1 defoult style,2 custom style( you should call setStyleCustom frist) (Android Only)
105- - ** id** : Number // local notification identify,l you can use it to cancel local notification
106- - ** title** : String // local notification title
107- - ** content** : String // local notification content
114+ - ** id** : Number // local notification identify,l you can use it to cancel local notification
115+ - ** title** : String // local notification title
116+ - ** content** : String // local notification content
108117 - ** extra** : Object // local notification extra (key-value)
109118 - ** fireTime** : Number // show local notification time(ms)
110119 - ** badge** : Number // when local notification fire, application icon will set badge with this value (iOS Only)
@@ -127,6 +136,24 @@ reset tags.
127136 )
128137 ```
129138
139+
140+ #### clearAllNotifications
141+
142+ Clear all notifications.
143+
144+ ```
145+ JPushModule.clearAllNotifications();
146+ ```
147+
148+ #### clearNotificationById
149+
150+ Clear notification by id(int type).
151+
152+ ```
153+ var id = 5;
154+ JPushModule.clearNotificationById(id);
155+ ```
156+
130157#### Open Notification Event
131158
132159** NOTE
** : iOS need update to
[email protected] +
@@ -185,8 +212,6 @@ reset tags.
185212 ```
186213
187214
188-
189-
190215### iOS Only API
191216
192217All apis can find in jpush-react-native/index.js.
@@ -282,14 +307,6 @@ setLocalNotification( Date, // date local notification fire data
282307 JPushInterface.init(this);
283308 ```
284309
285- - #### stopPush
286-
287- Stop push. Suggest invokes in ` MainActivity ` 's ` onStop ` method:
288-
289- ```
290- JPushInterface.onStop(this);
291- ```
292-
293310- #### resumePush
294311
295312 Resume push. Suggest invokes in ` MainActivity ` 's ` onResume ` method:
@@ -324,23 +341,6 @@ setLocalNotification( Date, // date local notification fire data
324341 });
325342 ```
326343
327- - #### clearAllNotifications
328-
329- Clear all notifications.
330-
331- ```
332- JPushModule.clearAllNotifications();
333- ```
334-
335- - #### clearNotificationById
336-
337- Clear notification by id(int type).
338-
339- ```
340- var id = 5;
341- JPushModule.clearNotificationById(id);
342- ```
343-
344344- #### getInfo
345345
346346 Get device's infomation.
0 commit comments