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

Commit 6f2bc2c

Browse files
This seems better
1 parent 0508c03 commit 6f2bc2c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

demo/app/main-view-model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export class HelloWorldModel extends Observable {
255255
}
256256
},
257257
onMessageReceivedCallback: message => {
258+
console.log("Push message received");
258259
setTimeout(() => {
259260
alert({
260261
title: "Push message!",

src/firebase.ios.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,9 @@ const handleRemoteNotification = (app, userInfo) => {
4747
}
4848

4949
firebase._pendingNotifications.push(userInfoJSON);
50-
if (app.applicationState === UIApplicationState.Active) {
51-
// If this is called from applicationDidFinishLaunchingWithOptions probably the app was dead (background)
52-
userInfoJSON.foreground = true;
53-
if (firebase._receivedNotificationCallback !== null) {
54-
firebase._processPendingNotifications();
55-
}
56-
} else {
57-
userInfoJSON.foreground = false;
50+
userInfoJSON.foreground = app.applicationState === UIApplicationState.Active;
51+
if (firebase._receivedNotificationCallback !== null) {
52+
firebase._processPendingNotifications();
5853
}
5954
};
6055

0 commit comments

Comments
 (0)