diff --git a/src/notifications/senders/AppleNotificationSender.ts b/src/notifications/senders/AppleNotificationSender.ts index 898bf05..2f458af 100644 --- a/src/notifications/senders/AppleNotificationSender.ts +++ b/src/notifications/senders/AppleNotificationSender.ts @@ -107,15 +107,21 @@ export class AppleNotificationSender { resolve(); }); + const customKeys = { + ...notificationAlertArguments.customKeys, + } + delete notificationAlertArguments.customKeys; + // See https://developer.apple.com/documentation/usernotifications/generating-a-remote-notification // for notification payload examples - req.write(JSON.stringify({ + const payload = JSON.stringify({ aps: { alert: notificationAlertArguments, sound: "default" }, - ...notificationAlertArguments.customKeys, - })); + customKeys, + }); + req.write(payload); req.end(); }); return true;