Merge pull request #403 from dvel-Inc/local_notification/opened_from_tray
Set opened_from_tray for local_notification
This commit is contained in:
commit
7fd5322cbd
|
@ -142,6 +142,7 @@ RCT_EXPORT_MODULE()
|
||||||
+ (void)didReceiveLocalNotification:(UILocalNotification *)notification {
|
+ (void)didReceiveLocalNotification:(UILocalNotification *)notification {
|
||||||
NSMutableDictionary* data = [[NSMutableDictionary alloc] initWithDictionary: notification.userInfo];
|
NSMutableDictionary* data = [[NSMutableDictionary alloc] initWithDictionary: notification.userInfo];
|
||||||
[data setValue:@"local_notification" forKey:@"_notificationType"];
|
[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}];
|
[[NSNotificationCenter defaultCenter] postNotificationName:MESSAGING_NOTIFICATION_RECEIVED object:self userInfo:@{@"data": data}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue