Commit 9e1e4950 authored by Libin Lu's avatar Libin Lu

Merge pull request #9 from xxsnakerxx/android_resume_null_extras

[Android] Checking newIntent extras for null onResume
parents 212eb474 acf14bd2
......@@ -123,11 +123,14 @@ public class FIRMessagingModule extends ReactContextBaseJavaModule implements Li
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);
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;
}
......
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