|
10 | 10 | - [Open Notification Event](#open-notification-event) |
11 | 11 | - [Receive Notification event](#receive-notification-event) |
12 | 12 | - [Receive Custom Message Event](#receive-custom-message-event) |
| 13 | + - [sendLocalNotification](#sendlocalnotification) |
13 | 14 | - [iOS Only API](#ios-only-api) |
14 | 15 | - [setBadge](#setbadge) |
15 | 16 | - [getBadge](#getbadge) |
@@ -96,6 +97,37 @@ reset tags. |
96 | 97 | JPushModule.cleanTags((success) => {}) |
97 | 98 | ``` |
98 | 99 |
|
| 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 | + |
99 | 131 | #### Open Notification Event |
100 | 132 |
|
101 | 133 | **NOTE **: iOS need update to [email protected]+ |
@@ -149,7 +181,7 @@ reset tags. |
149 | 181 |
|
150 | 182 | - removeReceiveCustomMsgListener(function) |
151 | 183 |
|
152 | | - ``` |
| 184 | + ```javascript |
153 | 185 | JPushModule.removeReceiveCustomMsgListener(callback); |
154 | 186 | ``` |
155 | 187 |
|
|
0 commit comments