mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
make getAPNsFullUrlToUse public and testable
This commit is contained in:
@@ -126,13 +126,13 @@ export class NotificationService {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getAPNsFullUrlToUse(deviceId: string) {
|
public static getAPNsFullUrlToUse(deviceId: string) {
|
||||||
// Construct the fetch request
|
// Construct the fetch request
|
||||||
const devBaseUrl = "https://api.sandbox.push.apple.com"
|
const devBaseUrl = "https://api.sandbox.push.apple.com"
|
||||||
const prodBaseUrl = "https://api.push.apple.com"
|
const prodBaseUrl = "https://api.push.apple.com"
|
||||||
const path = "/3/device/" + deviceId;
|
const path = "/3/device/" + deviceId;
|
||||||
|
|
||||||
let urlToUse = prodBaseUrl;
|
let urlToUse = prodBaseUrl + path;
|
||||||
if (process.env.NODE_ENV !== "production") {
|
if (process.env.NODE_ENV !== "production") {
|
||||||
urlToUse = devBaseUrl + path;
|
urlToUse = devBaseUrl + path;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user