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 0b6cd6b4688c6951391b6d56b05b3e1a4f16e867..43a6b45462dcaec0b57a610a9e069932e15cdf37 100644 --- a/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java +++ b/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java @@ -122,12 +122,15 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li @Override public void onHostResume() { Intent newIntent = getCurrentActivity().getIntent(); - if(newIntent != mIntent && newIntent != null){ - WritableMap params = Arguments.fromBundle(newIntent.getExtras()); - WritableMap fcm = Arguments.createMap(); - fcm.putString("action", newIntent.getAction()); - params.putMap("fcm", fcm); - sendEvent("FCMNotificationReceived", params); + if(newIntent != mIntent && newIntent != null && newIntent.getExtras() != null){ + Bundle extras = newIntent.getExtras(); + if (extras != null) { + WritableMap params = Arguments.fromBundle(extras); + WritableMap fcm = Arguments.createMap(); + fcm.putString("action", newIntent.getAction()); + params.putMap("fcm", fcm); + sendEvent("FCMNotificationReceived", params); + } } mIntent = newIntent; }