Commit 232cbf28 authored by Dmitriy Kolesnikov's avatar Dmitriy Kolesnikov

Check newIntent extras for null

parent 212eb474
...@@ -122,13 +122,16 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li ...@@ -122,13 +122,16 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li
@Override @Override
public void onHostResume() { public void onHostResume() {
Intent newIntent = getCurrentActivity().getIntent(); Intent newIntent = getCurrentActivity().getIntent();
if(newIntent != mIntent && newIntent != null){ if(newIntent != mIntent && newIntent != null && newIntent.getExtras() != null){
WritableMap params = Arguments.fromBundle(newIntent.getExtras()); Bundle extras = newIntent.getExtras();
if (extras != null) {
WritableMap params = Arguments.fromBundle(extras);
WritableMap fcm = Arguments.createMap(); WritableMap fcm = Arguments.createMap();
fcm.putString("action", newIntent.getAction()); fcm.putString("action", newIntent.getAction());
params.putMap("fcm", fcm); params.putMap("fcm", fcm);
sendEvent("FCMNotificationReceived", params); sendEvent("FCMNotificationReceived", params);
} }
}
mIntent = newIntent; mIntent = newIntent;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment