diff --git a/src/services/NotificationService.ts b/src/services/NotificationService.ts index a6b9162..d21726a 100644 --- a/src/services/NotificationService.ts +++ b/src/services/NotificationService.ts @@ -126,8 +126,7 @@ export class NotificationService { await new Promise((resolve, reject) => { req.on('response', (headers, flags) => { if (headers[":status"] !== 200) { - console.error(`APNs request failed with status ${headers[":status"]}`); - reject(); + reject(`APNs request failed with status ${headers[":status"]}`); } resolve(); }); @@ -142,25 +141,6 @@ export class NotificationService { })); req.end(); }); - - // const response = await fetch(url, { - // method: "POST", - // headers, - // body: JSON.stringify({ - // aps: { - // alert: { - // title: "Shuttle is arriving", - // body: `Shuttle is approaching ${stop.name} in ${Math.ceil(eta.secondsRemaining / 60)} minutes.` - // } - // } - // }), - // }); - // const json = await response.json(); - - // if (response.status !== 200) { - // console.error(`Notification failed for device ${deviceId}:`, json.reason); - // return false; - // } return true; } catch(e) { console.error(e);