// // 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 createSubscription(account: UserAccountInfo) throws -> PushSubscription { throw Disabled() } func removeSubscription(account: UserAccountInfo) { } 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" } } }