Merge pull request #404 from dvel-Inc/v2.x.x_local_notification/opened_from_tray

[v2.x.x] Set opened_from_tray true for local notification
This commit is contained in:
Michael Diarmid 2017-09-13 15:20:57 +01:00 committed by GitHub
commit a383225730
1 changed files with 1 additions and 0 deletions

View File

@ -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}];
}