mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
move shouldSendNotifications property to the AppleNotificationSender
This commit is contained in:
@@ -16,6 +16,9 @@ export class AppleNotificationSender {
|
||||
private apnsToken: string | undefined = undefined;
|
||||
private _lastRefreshedTimeMs: number | undefined = undefined;
|
||||
|
||||
constructor(private shouldActuallySendNotifications = true) {
|
||||
}
|
||||
|
||||
get lastRefreshedTimeMs(): number | undefined {
|
||||
return this._lastRefreshedTimeMs;
|
||||
}
|
||||
@@ -64,6 +67,11 @@ export class AppleNotificationSender {
|
||||
* notification was sent successfully.
|
||||
*/
|
||||
public async sendNotificationImmediately(deviceId: string, notificationAlertArguments: NotificationAlertArguments) {
|
||||
if (!this.shouldActuallySendNotifications) {
|
||||
// pretend that the notification sent
|
||||
return true;
|
||||
}
|
||||
|
||||
this.reloadAPNsTokenIfTimePassed();
|
||||
|
||||
const bundleId = process.env.APNS_BUNDLE_ID;
|
||||
|
||||
Reference in New Issue
Block a user