Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/push/providers.js
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | for (const provider of cachedAPNProviders.values()) { | ||||
provider?.shutdown(); | provider?.shutdown(); | ||||
} | } | ||||
} | } | ||||
function getAPNsNotificationTopic(codeVersion: ?number): string { | function getAPNsNotificationTopic(codeVersion: ?number): string { | ||||
return codeVersion && codeVersion >= 87 ? 'app.comm' : 'org.squadcal.app'; | return codeVersion && codeVersion >= 87 ? 'app.comm' : 'org.squadcal.app'; | ||||
} | } | ||||
type WebPushConfig = { +publicKey: string, +privateKey: string }; | |||||
async function getWebPushConfig(): Promise<?WebPushConfig> { | |||||
return await importJSON<WebPushConfig>({ | |||||
folder: 'secrets', | |||||
name: 'web_push_config', | |||||
}); | |||||
} | |||||
export { | export { | ||||
getAPNPushProfileForCodeVersion, | getAPNPushProfileForCodeVersion, | ||||
getFCMPushProfileForCodeVersion, | getFCMPushProfileForCodeVersion, | ||||
getAPNProvider, | getAPNProvider, | ||||
getFCMProvider, | getFCMProvider, | ||||
endFirebase, | endFirebase, | ||||
endAPNs, | endAPNs, | ||||
getAPNsNotificationTopic, | getAPNsNotificationTopic, | ||||
getWebPushConfig, | |||||
}; | }; |