Add support for cancelAllLocalNotifications

Summary: Closes https://github.com/facebook/react-native/pull/2980

Reviewed By: svcscm

Differential Revision: D2550080

Pulled By: javache

fb-gh-sync-id: 76a7088f4f86191b02e6c176e4a8a7bc85f90835
This commit is contained in:
Adam Terlson 2015-10-16 10:39:38 -07:00 committed by facebook-github-bot-7
parent 2608efccb6
commit da250671e5
2 changed files with 12 additions and 1 deletions

View File

@ -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
*/

View File

@ -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