mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-03 22:48:36 +08:00
Set opened_from_tray true if a local notification is clicked from notification center/tray
This commit is contained in:
@@ -142,6 +142,7 @@ RCT_EXPORT_MODULE()
|
||||
+ (void)didReceiveLocalNotification:(UILocalNotification *)notification {
|
||||
NSMutableDictionary* data = [[NSMutableDictionary alloc] initWithDictionary: notification.userInfo];
|
||||
[data setValue:@"local_notification" forKey:@"_notificationType"];
|
||||
[data setValue:@(RCTSharedApplication().applicationState == UIApplicationStateInactive) forKey:@"opened_from_tray"];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:MESSAGING_NOTIFICATION_RECEIVED object:self userInfo:@{@"data": data}];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user