Skip to content

Commit

Permalink
Merge efe63f3 into b972cb6
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehardy authored Apr 29, 2021
2 parents b972cb6 + efe63f3 commit 652b47a
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void getInitialNotification(Promise promise) {
} else {
remoteMessageMap = ReactNativeFirebaseMessagingSerializer.remoteMessageToWritableMap(remoteMessage);
}
if (remoteMessageMap != null){
if (remoteMessageMap != null) {
promise.resolve(remoteMessageMap);
initialNotificationMap.put(messageId, true);
return;
Expand Down Expand Up @@ -228,9 +228,10 @@ public void onNewIntent(Intent intent) {
} else {
remoteMessageMap = ReactNativeFirebaseMessagingSerializer.remoteMessageToWritableMap(remoteMessage);
}

if (remoteMessageMap != null){
initialNotification = remoteMessageMap;

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();
ReactNativeFirebaseMessagingReceiver.notifications.remove(messageId);

ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance();
Expand Down

0 comments on commit 652b47a

Please sign in to comment.