diff --git a/packages/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java b/packages/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java index 71565b08caf..9286f95fbb2 100644 --- a/packages/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java +++ b/packages/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java @@ -29,6 +29,7 @@ import com.facebook.react.bridge.ReactMethod; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.WritableMap; +import com.facebook.react.bridge.WritableNativeMap; import com.google.android.gms.tasks.Tasks; import com.google.firebase.iid.FirebaseInstanceId; import com.google.firebase.messaging.FirebaseMessaging; @@ -231,7 +232,9 @@ public void onNewIntent(Intent intent) { if (remoteMessageMap != null) { // WritableNativeMap not be consumed twice. But it is resolved in future and in event below. Make a copy - issue #5231 - initialNotification = remoteMessageMap.copy(); + WritableNativeMap newInitialNotification = new WritableNativeMap(); + newInitialNotification.merge(remoteMessageMap); + initialNotification = newInitialNotification; ReactNativeFirebaseMessagingReceiver.notifications.remove(messageId); ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance(); diff --git a/packages/messaging/e2e/messaging.e2e.js b/packages/messaging/e2e/messaging.e2e.js index 07ad6160e18..70ac6fada17 100644 --- a/packages/messaging/e2e/messaging.e2e.js +++ b/packages/messaging/e2e/messaging.e2e.js @@ -15,7 +15,7 @@ * */ -describe('messaging()', function () { +describe.only('messaging()', function () { describe('namespace', function () { it('accessible from firebase.app()', function () { const app = firebase.app();