Skip to content

Commit f0318d2

Browse files
authored
fix(messaging, ios): native.getInitialNotification can be undefined (#5926)
1 parent e6fa566 commit f0318d2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/messaging/e2e/messaging.e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe('messaging()', function () {
142142

143143
describe('getInitialNotification', function () {
144144
it('returns null when no initial notification', async function () {
145-
should.equal(await firebase.messaging().getInitialNotification(), null);
145+
should.strictEqual(await firebase.messaging().getInitialNotification(), null);
146146
});
147147
});
148148

packages/messaging/lib/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ class FirebaseMessagingModule extends FirebaseModule {
122122
}
123123

124124
getInitialNotification() {
125-
return this.native.getInitialNotification();
125+
return this.native.getInitialNotification().then(value => {
126+
if (value) {
127+
return value;
128+
}
129+
return null;
130+
});
126131
}
127132

128133
getIsHeadless() {

0 commit comments

Comments
 (0)