add handling for error and successful return

This commit is contained in:
2025-02-03 22:42:25 -08:00
parent c5c0208371
commit 103ddef523

View File

@@ -111,9 +111,11 @@ export class NotificationService {
});
const json = await response.json();
// Check whether it was successful
// Return the result
return false;
if (response.status !== 200) {
console.error(`Notification failed for device ${deviceId}:`, json.reason);
return false;
}
return true;
}
private getAPNsFullUrlToUse(deviceId: string) {