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

Commit 56ceba2

Browse files
[ios][messaging] onMessaggeReceived callback not triggered when showNotificationsWhenInForeground is true #1371
1 parent 741471e commit 56ceba2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/messaging/messaging.ios.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,13 +538,12 @@ class UNUserNotificationCenterDelegateImpl extends NSObject implements UNUserNot
538538
userInfoJSON["showWhenInForeground"] === true || // ...this is for non-FCM...
539539
(userInfoJSON.aps && userInfoJSON.aps.showWhenInForeground === true) // ...and this as well (so users can choose where to put it).
540540
) {
541-
// don't invoke the callback here, since the app shouldn't fi. navigate to a new page unless the user pressed the notification
542541
completionHandler(UNNotificationPresentationOptions.Alert | UNNotificationPresentationOptions.Sound | UNNotificationPresentationOptions.Badge);
543542
} else {
544-
// invoke the callback here, since in this case 'userNotificationCenterDidReceiveNotificationResponseWithCompletionHandler' doesn't run
545-
this.callback(notification);
546543
completionHandler(0);
547544
}
545+
546+
this.callback(notification);
548547
}
549548

550549
public userNotificationCenterDidReceiveNotificationResponseWithCompletionHandler(center: UNUserNotificationCenter, response: UNNotificationResponse, completionHandler: () => void): void {

0 commit comments

Comments
 (0)