11[ 中文文档] ( ./APIs_zh.md )
22
3- - - [ Common API:] (#Common API)
4- - [ getRegistrationID] ( #getRegistrationID )
5- - [ setAlias] ( #setAlias )
6- - [ addTags] ( #addTags )
7- - [ setTags] ( #setTags )
8- - [ cleanTags] ( #cleanTags )
9- - [ setAlias] ( #setAlias )
10- - [ Open Notification Event] (#Open Notification Event)
11- - [ Receive Notification event] (#Receive Notification Event)
12- - [ Receive Custom Message Event] (#Receive Custom Message Event)
13- - [ iOS Only API:] (#iOS Only API)
14- - [ setBadge] ( #setBadge )
15- - [ getBadge] ( #getBadge )
16- - [ setLocalNotification] ( #setLocalNotification )
17- - [ Open Notification Launch App Event] (#Open Notification Launch App Event)
18- - [ Network Did Login Event] (#Network Did Login Event)
19- - [ Android Only API:] (Android Only API)
20- - [ initPush] ( #initPush )
21- - [ stopPush] ( #stopPush )
22- - [ resumePush] ( #resumePush )
23- - [ crashLogOFF] ( #crashLogOFF )
24- - [ crashLogON] ( #crashLogON )
25- - [ notifyJSDidLoad] ( #notifyJSDidLoad )
26- - [ clearAllNotifications] ( #clearAllNotifications )
27- - [ clearNotificationById] ( #clearNotificationById )
3+ - [ Common API] ( #common-api )
4+ - [ getRegistrationID] ( #getregistrationid )
5+ - [ setAlias] ( #setalias )
6+ - [ addTags] ( #addtags )
7+ - [ setTags] ( #settags )
8+ - [ cleanTags] ( #cleantags )
9+ - [ setAlias] ( #setalias )
10+ - [ Open Notification Event] ( #open-notification-event )
11+ - [ Receive Notification event] ( #receive-notification-event )
12+ - [ Receive Custom Message Event] ( #receive-custom-message-event )
13+ - [ sendLocalNotification] ( #sendlocalnotification )
14+ - [ iOS Only API] ( #ios-only-api )
15+ - [ setBadge] ( #setbadge )
16+ - [ getBadge] ( #getbadge )
17+ - [ setLocalNotification] ( #setlocalnotification )
18+ - [ Open Notification Launch App Event] ( #open-notification-launch-app-event )
19+ - [ Network Did Login Event] ( #network-did-login-event )
20+ - [ Android Only API] ( #android-only-api )
21+ - [ initPush] ( #initpush )
22+ - [ stopPush] ( #stoppush )
23+ - [ resumePush] ( #resumepush )
24+ - [ crashLogOFF] ( #crashlogoff )
25+ - [ crashLogON] ( #crashlogon )
26+ - [ notifyJSDidLoad] ( #notifyjsdidload )
27+ - [ clearAllNotifications] ( #clearallnotifications )
28+ - [ clearNotificationById] ( #clearnotificationbyId )
2829 - [ getInfo] ( #getInfo )
29- - [ setStyleBasic] ( #setStyleBasic )
30- - [ setStyleCustom] ( #setStyleCustom )
31- - [ setLatestNotificationNumber] ( #setLatestNotificationNumber )
32- - [ setSilenceTime] ( #setSilenceTime )
33- - [ setPushTime] ( #setPushTime )
34- - [ addGetRegistrationIdListener] ( #addGetRegistrationIdListener )
35- - [ removeGetRegistrationIdListener] ( #removeGetRegistrationIdListener )
30+ - [ setStyleBasic] ( #setstylebasic )
31+ - [ setStyleCustom] ( #setstylecustom )
32+ - [ setLatestNotificationNumber] ( #setlatestnotificationnumber )
33+ - [ setSilenceTime] ( #setsilencetime )
34+ - [ setPushTime] ( #setpushtime )
35+ - [ addGetRegistrationIdListener] ( #addgetregistrationidlistener )
36+ - [ removeGetRegistrationIdListener] ( #removegetregistrationidlistener )
3637
37- Note: In Android, you must call initPush first, iOS doesn't need.
38+ ** Note** : In Android, you must call initPush first, iOS doesn't need.
3839
3940### Common API
4041
@@ -96,9 +97,40 @@ reset tags.
9697 JPushModule .cleanTags ((success ) => {})
9798 ```
9899
100+ #### sendLocalNotification
101+
102+ - sendLocalNotification(notification)
103+
104+ - ** 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
108+ - ** extra** : Object // local notification extra (key-value)
109+ - ** fireTime** : Number // show local notification time(ms)
110+ - ** badge** : Number // when local notification fire, application icon will set badge with this value (iOS Only)
111+ - ** soundName** : String // if you what to custom notification sound ,you should specify audio file name (iOS Only)
112+ - ** subtitle** : String // set local notification subtitle (iOS10+ Only)
113+
114+ ``` javascript
115+ var currentDate = new Date ()
116+ JPushModule .sendLocalNotification (
117+ {
118+ id: 5 ,
119+ title: ' haha' ,
120+ content: ' content' ,
121+ extra: {key1: ' value1' ,key2: ' value2' },
122+ fireTime: currentDate .getTime () + 3000 ,
123+ badge: 8 ,
124+ sound: ' fasdfa' ,
125+ subtitle: " subtitle" ,
126+ title: ' title'
127+ }
128+ )
129+ ```
130+
99131#### Open Notification Event
100132
101- ** NOTE
: ** iOS need update to
[email protected] +
133+ ** NOTE
** : iOS need update to
[email protected] +
102134
103135- addReceiveOpenNotificationListener(function)
104136
@@ -114,7 +146,7 @@ reset tags.
114146 ```
115147
116148#### Receive Notification Event
117- ** NOTE
: ** iOS need update to
[email protected] +
149+ ** NOTE
** : iOS need update to
[email protected] +
118150
119151- addReceiveNotificationListener(function)
120152
@@ -135,7 +167,7 @@ reset tags.
135167
136168#### Receive Custom Message Event
137169** receive custom message** (Add this listener to receive custom message.)
138- ** NOTE
: ** iOS need update to
[email protected] +
170+ ** NOTE
** : iOS need update to
[email protected] +
139171- addReceiveCustomMsgListener(function)
140172
141173 ``` javascript
@@ -149,7 +181,7 @@ reset tags.
149181
150182- removeReceiveCustomMsgListener(function)
151183
152- ```
184+ ``` javascript
153185 JPushModule .removeReceiveCustomMsgListener (callback);
154186 ```
155187
@@ -205,7 +237,7 @@ setLocalNotification( Date, // date local notification fire data
205237
206238#### Open Notification Launch App Event
207239
208- ** NOTE
: ** iOS need update to
[email protected] +
240+ ** NOTE
** : iOS need update to
[email protected] +
209241
210242- addOpenNotificationLaunchAppListener(function)
211243
@@ -228,7 +260,7 @@ setLocalNotification( Date, // date local notification fire data
228260
229261** Network Did Login Event**
230262
231- ** NOTE
: ** iOS need update to
[email protected] +
263+ ** NOTE
** : iOS need update to
[email protected] +
232264
233265- addnetworkDidLoginListener(function)
234266
0 commit comments