diff --git a/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java b/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java index e0b036b9f1c8f02199ca28423b7f65493b4cb765..a6f6a6e8f1c47eeeb01563d03d217ed79a6d4b6d 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java @@ -129,6 +129,7 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li } WritableMap fcm = Arguments.createMap(); fcm.putString("action", intent.getAction()); + fcm.putInt("opened_from_tray", 1); params.putMap("fcm", fcm); return params; } diff --git a/ios/RNFIRMesssaging.m b/ios/RNFIRMesssaging.m index a6e011f73ea5615d7302898fab60f2d10e90c868..65a32e657055bc1df910c3541c72824c69b8f5ae 100644 --- a/ios/RNFIRMesssaging.m +++ b/ios/RNFIRMesssaging.m @@ -118,8 +118,10 @@ RCT_EXPORT_METHOD(unsubscribeFromTopic: (NSString*) topic) - (void)handleRemoteNotificationReceived:(NSNotification *)notification { + NSMutableDictionary *data = [[NSMutableDictionary alloc]initWithDictionary: notification.userInfo]; + [data setValue:@(RCTSharedApplication().applicationState == UIApplicationStateInactive) forKey:@"opened_from_tray"]; [_bridge.eventDispatcher sendDeviceEventWithName:FCMNotificationReceived - body:notification.userInfo]; + body:data]; } @end