Commit aa7625ce authored by Doron Pearl's avatar Doron Pearl Committed by GitHub

fix background PN is received as foreground

for the first time. refs #268 
The `didReceiveRemoteNotification` checks for the current app state which will be active and hence wrongly emit the notification to JS as foreground. However at the exact time when the user opened the notification, the app was at the background hence this is a background notification by definition.

In other words, conceptually determining if the notification is background or foreground should NOT be based on the time it was consumed from the queue but on the time it was received. Practically, if it was queued, then the app must have been in the background ==> background notification.
parent 6cc14dfb
......@@ -576,7 +576,7 @@ RCT_EXPORT_METHOD(consumeBackgroundQueue)
// Push background notifications to JS
[[RNNotificationsBridgeQueue sharedInstance] consumeNotificationsQueue:^(NSDictionary* notification) {
[RNNotifications didReceiveRemoteNotification:notification];
[RNNotifications didReceiveNotificationOnBackgroundState:notification];
}];
// Push opened local notifications
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment