make getAPNsFullUrlToUse public and testable

This commit is contained in:
2025-02-03 23:23:21 -08:00
parent 602ccf8139
commit c593fe14e1

View File

@@ -126,13 +126,13 @@ export class NotificationService {
return true;
}
private getAPNsFullUrlToUse(deviceId: string) {
public static getAPNsFullUrlToUse(deviceId: string) {
// Construct the fetch request
const devBaseUrl = "https://api.sandbox.push.apple.com"
const prodBaseUrl = "https://api.push.apple.com"
const path = "/3/device/" + deviceId;
let urlToUse = prodBaseUrl;
let urlToUse = prodBaseUrl + path;
if (process.env.NODE_ENV !== "production") {
urlToUse = devBaseUrl + path;
}