From aec4f34a60ab027302987f97f5888d7ab757fd80 Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Fri, 12 Apr 2024 12:49:24 +0200 Subject: [PATCH] fix: migrate to new API --- src/libs/Notification/PushNotification/index.native.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/Notification/PushNotification/index.native.ts b/src/libs/Notification/PushNotification/index.native.ts index 4e028ad82392..d45d076a8adb 100644 --- a/src/libs/Notification/PushNotification/index.native.ts +++ b/src/libs/Notification/PushNotification/index.native.ts @@ -64,7 +64,7 @@ function pushNotificationEventCallback(eventType: EventType, notification: PushP */ function refreshNotificationOptInStatus() { Airship.push.getNotificationStatus().then((notificationStatus) => { - const isOptedIn = notificationStatus.airshipOptIn && notificationStatus.systemEnabled; + const isOptedIn = notificationStatus.isOptedIn && notificationStatus.areNotificationsAllowed; if (isOptedIn === isUserOptedInToPushNotifications) { return; } @@ -94,7 +94,7 @@ const init: Init = () => { }); // Keep track of which users have enabled push notifications via an NVP. - Airship.addListener(EventType.NotificationOptInStatus, refreshNotificationOptInStatus); + Airship.addListener(EventType.PushNotificationStatusChangedStatus, refreshNotificationOptInStatus); ForegroundNotifications.configureForegroundNotifications(); };