From 3f13f6f99aa6712d8609c5fadd0c2d8195912d07 Mon Sep 17 00:00:00 2001 From: Yedidya Kennard Date: Sun, 25 Feb 2018 16:10:15 +0200 Subject: [PATCH] Get local notification too --- RNNotifications/RNNotifications.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/RNNotifications/RNNotifications.m b/RNNotifications/RNNotifications.m index 9c61ca8..5be3894 100644 --- a/RNNotifications/RNNotifications.m +++ b/RNNotifications/RNNotifications.m @@ -516,8 +516,11 @@ RCT_EXPORT_METHOD(requestPermissionsWithCategories:(NSArray *)json) RCT_EXPORT_METHOD(getInitialNotification:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) { NSDictionary * notification = nil; - notification = [RNNotificationsBridgeQueue sharedInstance].openedRemoteNotification; + notification = [RNNotificationsBridgeQueue sharedInstance].openedRemoteNotification ? + [RNNotificationsBridgeQueue sharedInstance].openedRemoteNotification : + [RNNotificationsBridgeQueue sharedInstance].openedLocalNotification; [RNNotificationsBridgeQueue sharedInstance].openedRemoteNotification = nil; + [RNNotificationsBridgeQueue sharedInstance].openedLocalNotification = nil; resolve(notification); } -- 2.26.2