46 lines
933 B
Swift
46 lines
933 B
Swift
//
|
|
// DisabledPushManager.swift
|
|
// PushNotifications
|
|
//
|
|
// Created by Shadowfacts on 4/7/24.
|
|
//
|
|
|
|
import Foundation
|
|
import UserAccounts
|
|
|
|
class DisabledPushManager: _PushManager {
|
|
var enabled: Bool {
|
|
false
|
|
}
|
|
|
|
var pushProxyRegistration: PushProxyRegistration? {
|
|
nil
|
|
}
|
|
|
|
func pushSubscription(account: UserAccountInfo) -> PushSubscription? {
|
|
nil
|
|
}
|
|
|
|
func register(transactionID: UInt64) async throws -> PushProxyRegistration {
|
|
throw Disabled()
|
|
}
|
|
|
|
func unregister() async throws {
|
|
throw Disabled()
|
|
}
|
|
|
|
func updateIfNecessary() async {
|
|
}
|
|
|
|
func didRegisterForRemoteNotifications(deviceToken: Data) {
|
|
}
|
|
func didFailToRegisterForRemoteNotifications(error: any Error) {
|
|
}
|
|
|
|
struct Disabled: LocalizedError {
|
|
var errorDescription: String? {
|
|
"Push notifications disabled"
|
|
}
|
|
}
|
|
}
|