(
encryptedNotifUtilsAPI: EncryptedNotifUtilsAPI,
senderDeviceDescriptor: SenderDeviceDescriptor,
devices: $ReadOnlyArray<NotificationTargetDevice>,
notification: AndroidVisualNotification,
isNotificationSizeValid?: (
notification: AndroidVisualNotification,
) => boolean,
)
| 508 | } |
| 509 | |
| 510 | function prepareEncryptedAndroidVisualNotifications( |
| 511 | encryptedNotifUtilsAPI: EncryptedNotifUtilsAPI, |
| 512 | senderDeviceDescriptor: SenderDeviceDescriptor, |
| 513 | devices: $ReadOnlyArray<NotificationTargetDevice>, |
| 514 | notification: AndroidVisualNotification, |
| 515 | isNotificationSizeValid?: ( |
| 516 | notification: AndroidVisualNotification, |
| 517 | ) => boolean, |
| 518 | ): Promise< |
| 519 | $ReadOnlyArray<{ |
| 520 | +cryptoID: string, |
| 521 | +deliveryID: string, |
| 522 | +notification: AndroidVisualNotification, |
| 523 | +payloadSizeExceeded: boolean, |
| 524 | +encryptionOrder?: number, |
| 525 | }>, |
| 526 | > { |
| 527 | const notificationPromises = devices.map( |
| 528 | async ({ deliveryID, cryptoID, blobHolder }) => { |
| 529 | const notif = await encryptAndroidVisualNotification( |
| 530 | encryptedNotifUtilsAPI, |
| 531 | senderDeviceDescriptor, |
| 532 | cryptoID, |
| 533 | notification, |
| 534 | isNotificationSizeValid, |
| 535 | blobHolder, |
| 536 | ); |
| 537 | return { deliveryID, cryptoID, ...notif }; |
| 538 | }, |
| 539 | ); |
| 540 | return Promise.all(notificationPromises); |
| 541 | } |
| 542 | |
| 543 | function prepareEncryptedAndroidSilentNotifications( |
| 544 | encryptedNotifUtilsAPI: EncryptedNotifUtilsAPI, |
no test coverage detected