diff --git a/RNNotifications/RNNotifications.m b/RNNotifications/RNNotifications.m index 9c61ca876b8698e9d1b0b552c97c037536403894..5be3894a47b4bd1716d6a6c9ea33cd8cbaec0759 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); }