mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
add shuttleId as custom key in notification alert argument
This commit is contained in:
@@ -45,6 +45,9 @@ export class ETANotificationScheduler {
|
|||||||
const notificationAlertArguments: NotificationAlertArguments = {
|
const notificationAlertArguments: NotificationAlertArguments = {
|
||||||
title: "Shuttle is arriving",
|
title: "Shuttle is arriving",
|
||||||
body: `Shuttle is approaching ${stop.name} in ${Math.ceil(eta.secondsRemaining / 60)} minutes.`,
|
body: `Shuttle is approaching ${stop.name} in ${Math.ceil(eta.secondsRemaining / 60)} minutes.`,
|
||||||
|
customKeys: {
|
||||||
|
shuttleId,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
return this.appleNotificationSender.sendNotificationImmediately(deviceId, notificationAlertArguments);
|
return this.appleNotificationSender.sendNotificationImmediately(deviceId, notificationAlertArguments);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ interface APNsUrl {
|
|||||||
export interface NotificationAlertArguments {
|
export interface NotificationAlertArguments {
|
||||||
title: string;
|
title: string;
|
||||||
body: string;
|
body: string;
|
||||||
|
customKeys?: any,
|
||||||
}
|
}
|
||||||
|
|
||||||
export class AppleNotificationSender {
|
export class AppleNotificationSender {
|
||||||
@@ -110,7 +111,8 @@ export class AppleNotificationSender {
|
|||||||
aps: {
|
aps: {
|
||||||
alert: notificationAlertArguments,
|
alert: notificationAlertArguments,
|
||||||
sound: "default"
|
sound: "default"
|
||||||
}
|
},
|
||||||
|
...notificationAlertArguments.customKeys,
|
||||||
}));
|
}));
|
||||||
req.end();
|
req.end();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user