mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
update custom keys to not be included in alert property
This commit is contained in:
@@ -107,15 +107,21 @@ export class AppleNotificationSender {
|
|||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const customKeys = {
|
||||||
|
...notificationAlertArguments.customKeys,
|
||||||
|
}
|
||||||
|
delete notificationAlertArguments.customKeys;
|
||||||
|
|
||||||
// See https://developer.apple.com/documentation/usernotifications/generating-a-remote-notification
|
// See https://developer.apple.com/documentation/usernotifications/generating-a-remote-notification
|
||||||
// for notification payload examples
|
// for notification payload examples
|
||||||
req.write(JSON.stringify({
|
const payload = JSON.stringify({
|
||||||
aps: {
|
aps: {
|
||||||
alert: notificationAlertArguments,
|
alert: notificationAlertArguments,
|
||||||
sound: "default"
|
sound: "default"
|
||||||
},
|
},
|
||||||
...notificationAlertArguments.customKeys,
|
customKeys,
|
||||||
}));
|
});
|
||||||
|
req.write(payload);
|
||||||
req.end();
|
req.end();
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user