diff --git a/src/notifications/schedulers/ETANotificationScheduler.ts b/src/notifications/schedulers/ETANotificationScheduler.ts index 97a2d4d..3eb57cb 100644 --- a/src/notifications/schedulers/ETANotificationScheduler.ts +++ b/src/notifications/schedulers/ETANotificationScheduler.ts @@ -45,6 +45,9 @@ export class ETANotificationScheduler { const notificationAlertArguments: NotificationAlertArguments = { title: "Shuttle is arriving", body: `Shuttle is approaching ${stop.name} in ${Math.ceil(eta.secondsRemaining / 60)} minutes.`, + customKeys: { + shuttleId, + }, } return this.appleNotificationSender.sendNotificationImmediately(deviceId, notificationAlertArguments); } diff --git a/src/notifications/senders/AppleNotificationSender.ts b/src/notifications/senders/AppleNotificationSender.ts index 8e5904a..012846f 100644 --- a/src/notifications/senders/AppleNotificationSender.ts +++ b/src/notifications/senders/AppleNotificationSender.ts @@ -10,6 +10,7 @@ interface APNsUrl { export interface NotificationAlertArguments { title: string; body: string; + customKeys?: any, } export class AppleNotificationSender { @@ -110,7 +111,8 @@ export class AppleNotificationSender { aps: { alert: notificationAlertArguments, sound: "default" - } + }, + ...notificationAlertArguments.customKeys, })); req.end(); });