add shuttleId as custom key in notification alert argument

This commit is contained in:
2025-04-22 11:00:53 -07:00
parent 26b1e70f5b
commit 44a0f56b93
2 changed files with 6 additions and 1 deletions

View File

@@ -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);
} }

View File

@@ -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();
}); });