diff --git a/src/libs/Notification/PushNotification/subscribeToPushNotifications.ts b/src/libs/Notification/PushNotification/subscribeToPushNotifications.ts index 6ac700c66841..bae1548cc5f6 100644 --- a/src/libs/Notification/PushNotification/subscribeToPushNotifications.ts +++ b/src/libs/Notification/PushNotification/subscribeToPushNotifications.ts @@ -107,7 +107,7 @@ function applyOnyxData({reportID, onyxData, lastUpdateID, previousUpdateID, hasP */ return getLastUpdateIDAppliedToClient() .then((lastUpdateIDAppliedToClient) => applyOnyxUpdatesReliably(updates, {shouldRunSync: true, clientLastUpdateID: lastUpdateIDAppliedToClient})) - .then(() => NativeModules.PushNotificationBridge.finishBackgroundProcessing()); + .then(() => NativeModules.PushNotificationBridge?.finishBackgroundProcessing()); } function navigateToReport({reportID}: PushNotificationData): Promise { diff --git a/src/types/modules/react-native.d.ts b/src/types/modules/react-native.d.ts index 32f594e54cc6..2678d9dcb1f8 100644 --- a/src/types/modules/react-native.d.ts +++ b/src/types/modules/react-native.d.ts @@ -64,7 +64,7 @@ declare module 'react-native' { ShortcutManager: ShortcutManagerModule; ShareActionHandler: ShareActionHandlerModule; TestToolsBridge: TestToolsBridge; - PushNotificationBridge: PushNotificationBridge; + PushNotificationBridge?: PushNotificationBridge; } namespace Animated {