diff --git a/native/push/ios.js b/native/push/ios.js --- a/native/push/ios.js +++ b/native/push/ios.js @@ -75,15 +75,17 @@ return !permissions.alert || !permissions.badge || !permissions.sound; } +export type CoreIOSNotificationBackgroundData = { + +messageInfosArray: $ReadOnlyArray, +}; + function getCommIOSNotificationsEventEmitter(): NativeEventEmitter< $ReadOnly<{ remoteNotificationsRegistered: [{ +deviceToken: ?string }], remoteNotificationsRegistrationFailed: [void], notificationReceivedForeground: [CoreIOSNotificationData], notificationOpened: [CoreIOSNotificationData], - notificationReceivedBackground: [ - { +messageInfosArray: $ReadOnlyArray }, - ], + notificationReceivedBackground: [CoreIOSNotificationBackgroundData], }>, > { return new NativeEventEmitter(CommIOSNotifications); diff --git a/native/push/push-handler.react.js b/native/push/push-handler.react.js --- a/native/push/push-handler.react.js +++ b/native/push/push-handler.react.js @@ -68,6 +68,7 @@ iosPushPermissionResponseReceived, CommIOSNotifications, getCommIOSNotificationsEventEmitter, + type CoreIOSNotificationBackgroundData, } from './ios.js'; import { type MessageListParams, @@ -591,7 +592,9 @@ ); }; - iosBackgroundNotificationReceived = backgroundData => { + iosBackgroundNotificationReceived = ( + backgroundData: CoreIOSNotificationBackgroundData, + ) => { const convertedMessageInfos = backgroundData.messageInfosArray .flatMap(convertNotificationMessageInfoToNewIDSchema) .filter(Boolean);