Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 733f9b1

Browse files
Merge pull request #726 from abhayastudios/master
Fix for issue #488 - prevent cyclic notification message structure on iOS
2 parents 23cb646 + 7f94a05 commit 733f9b1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/firebase.ios.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,9 @@ firebase._processPendingNotifications = () => {
413413
userInfoJSON.body = userInfoJSON.aps.alert.body;
414414
}
415415
// also, to make the ts.d happy copy all properties to a data element
416-
userInfoJSON.data = userInfoJSON;
416+
if (!userInfoJSON.hasOwnProperty('data')) { userInfoJSON.data = {}; }
417+
Object.keys(userInfoJSON).forEach((key) => { if (key!=='data') userInfoJSON.data[key] = userInfoJSON[key]; })
418+
417419
// cleanup
418420
userInfoJSON.aps = undefined;
419421
firebase._receivedNotificationCallback(userInfoJSON);

0 commit comments

Comments
 (0)