@@ -132,6 +132,41 @@ export const App = (): React.Node => {
132132 } ) ;
133133 } ;
134134
135+ const addMultipleRequests = () => {
136+ PushNotificationIOS . addNotificationRequest ( {
137+ id : 'test-1' ,
138+ title : 'First' ,
139+ subtitle : 'subtitle' ,
140+ body : 'First Notification out of 3' ,
141+ category : 'test' ,
142+ threadId : 'thread-id' ,
143+ fireDate : new Date ( new Date ( ) . valueOf ( ) + 10000 ) ,
144+ repeats : true ,
145+ } ) ;
146+
147+ PushNotificationIOS . addNotificationRequest ( {
148+ id : 'test-2' ,
149+ title : 'Second' ,
150+ subtitle : 'subtitle' ,
151+ body : 'Second Notification out of 3' ,
152+ category : 'test' ,
153+ threadId : 'thread-id' ,
154+ fireDate : new Date ( new Date ( ) . valueOf ( ) + 12000 ) ,
155+ repeats : true ,
156+ } ) ;
157+
158+ PushNotificationIOS . addNotificationRequest ( {
159+ id : 'test-3' ,
160+ title : 'Third' ,
161+ subtitle : 'subtitle' ,
162+ body : 'Third Notification out of 3' ,
163+ category : 'test' ,
164+ threadId : 'thread-id' ,
165+ fireDate : new Date ( new Date ( ) . valueOf ( ) + 14000 ) ,
166+ repeats : true ,
167+ } ) ;
168+ } ;
169+
135170 const getPendingNotificationRequests = () => {
136171 PushNotificationIOS . getPendingNotificationRequests ( ( requests ) => {
137172 Alert . alert ( 'Push Notification Received' , JSON . stringify ( requests ) , [
@@ -179,6 +214,10 @@ export const App = (): React.Node => {
179214 PushNotificationIOS . removeAllPendingNotificationRequests ( ) ;
180215 } ;
181216
217+ const removePendingNotificationRequests = () => {
218+ PushNotificationIOS . removePendingNotificationRequests ( [ 'test-1' , 'test-2' ] ) ;
219+ } ;
220+
182221 const onRegistered = (deviceToken) => {
183222 Alert . alert ( 'Registered For Remote Push' , `Device Token: ${ deviceToken } ` , [
184223 {
@@ -279,10 +318,18 @@ export const App = (): React.Node => {
279318 onPress = { addNotificationRequest }
280319 label = "Add Notification Request"
281320 />
321+ < Button
322+ onPress = { addMultipleRequests }
323+ label = "Add Multiple Notification Requests"
324+ />
282325 < Button
283326 onPress = { setNotificationCategories }
284327 label = "Set notification categories"
285328 />
329+ < Button
330+ onPress = { removePendingNotificationRequests }
331+ label = "Remove Partial Pending Notification Requests"
332+ />
286333 < Button
287334 onPress = { removeAllPendingNotificationRequests }
288335 label = "Remove All Pending Notification Requests"
0 commit comments