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

Commit 3b36a9f

Browse files
committed
check if trigger is a push notification
1 parent 3ea3a31 commit 3b36a9f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/messaging/messaging.ios.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ class FirebaseNotificationDelegateObserverImpl implements DelegateObserver {
529529
public userNotificationCenterWillPresentNotificationWithCompletionHandler(center: UNUserNotificationCenter, notification: UNNotification, completionHandler: (p1: UNNotificationPresentationOptions) => void, next: () => void): void {
530530
const userInfo = notification.request.content.userInfo;
531531
const userInfoJSON = firebaseUtils.toJsObject(userInfo);
532-
if (!userInfoJSON["gcm.message_id"]) { // not a firebase message!
532+
if (!(notification.request.trigger instanceof UNPushNotificationTrigger)) { // not a firebase message!
533533
next();
534534
return;
535535
}
@@ -548,9 +548,7 @@ class FirebaseNotificationDelegateObserverImpl implements DelegateObserver {
548548
}
549549

550550
public userNotificationCenterDidReceiveNotificationResponseWithCompletionHandler(center: UNUserNotificationCenter, response: UNNotificationResponse, completionHandler: () => void, next: () => void): void {
551-
const userInfo = response.notification.request.content.userInfo;
552-
const userInfoJSON = firebaseUtils.toJsObject(userInfo);
553-
if (!userInfoJSON["gcm.message_id"]) { // not a firebase message!
551+
if (!(response.notification.request.trigger instanceof UNPushNotificationTrigger)) { // not a firebase message!
554552
next();
555553
return;
556554
}

0 commit comments

Comments
 (0)