mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
play the default sound when the notification is sent
This commit is contained in:
@@ -96,7 +96,7 @@ export class AppleNotificationSender {
|
|||||||
req.setEncoding('utf8');
|
req.setEncoding('utf8');
|
||||||
|
|
||||||
await new Promise<void>((resolve, reject) => {
|
await new Promise<void>((resolve, reject) => {
|
||||||
req.on('response', (headers, flags) => {
|
req.on('response', (headers, _flags) => {
|
||||||
if (headers[":status"] !== 200) {
|
if (headers[":status"] !== 200) {
|
||||||
reject(`APNs request failed with status ${headers[":status"]}`);
|
reject(`APNs request failed with status ${headers[":status"]}`);
|
||||||
}
|
}
|
||||||
@@ -106,6 +106,7 @@ export class AppleNotificationSender {
|
|||||||
req.write(JSON.stringify({
|
req.write(JSON.stringify({
|
||||||
aps: {
|
aps: {
|
||||||
alert: notificationAlertArguments,
|
alert: notificationAlertArguments,
|
||||||
|
sound: "default"
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
req.end();
|
req.end();
|
||||||
@@ -130,12 +131,11 @@ export class AppleNotificationSender {
|
|||||||
const path = "/3/device/" + deviceId;
|
const path = "/3/device/" + deviceId;
|
||||||
const fullUrl = hostToUse + path;
|
const fullUrl = hostToUse + path;
|
||||||
|
|
||||||
const constructedObject = {
|
return {
|
||||||
fullUrl,
|
fullUrl,
|
||||||
host: hostToUse,
|
host: hostToUse,
|
||||||
path,
|
path,
|
||||||
}
|
};
|
||||||
return constructedObject;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user