diff --git a/Libraries/PushNotificationIOS/PushNotificationIOS.js b/Libraries/PushNotificationIOS/PushNotificationIOS.js index 68edb9579..d4735fb41 100644 --- a/Libraries/PushNotificationIOS/PushNotificationIOS.js +++ b/Libraries/PushNotificationIOS/PushNotificationIOS.js @@ -82,6 +82,13 @@ class PushNotificationIOS { RCTPushNotificationManager.scheduleLocalNotification(details); } + /** + * Cancels all scheduled localNotifications + */ + static cancelAllLocalNotifications() { + RCTPushNotificationManager.cancelAllLocalNotifications(); + } + /** * Sets the badge number for the app icon on the home screen */ diff --git a/Libraries/PushNotificationIOS/RCTPushNotificationManager.m b/Libraries/PushNotificationIOS/RCTPushNotificationManager.m index 3e45add44..f38d00b7b 100644 --- a/Libraries/PushNotificationIOS/RCTPushNotificationManager.m +++ b/Libraries/PushNotificationIOS/RCTPushNotificationManager.m @@ -212,10 +212,14 @@ RCT_EXPORT_METHOD(presentLocalNotification:(UILocalNotification *)notification) [RCTSharedApplication() presentLocalNotificationNow:notification]; } - RCT_EXPORT_METHOD(scheduleLocalNotification:(UILocalNotification *)notification) { [RCTSharedApplication() scheduleLocalNotification:notification]; } +RCT_EXPORT_METHOD(cancelAllLocalNotifications) +{ + [RCTSharedApplication() cancelAllLocalNotifications]; +} + @end