2024-04-08 13:48:40 +00:00
|
|
|
//
|
|
|
|
// DisabledPushManager.swift
|
|
|
|
// PushNotifications
|
|
|
|
//
|
|
|
|
// Created by Shadowfacts on 4/7/24.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import UserAccounts
|
|
|
|
|
|
|
|
class DisabledPushManager: _PushManager {
|
|
|
|
var enabled: Bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
|
2024-04-09 16:35:51 +00:00
|
|
|
var proxyRegistration: PushProxyRegistration? {
|
2024-04-08 13:48:40 +00:00
|
|
|
nil
|
|
|
|
}
|
|
|
|
|
2024-04-08 16:25:39 +00:00
|
|
|
func createSubscription(account: UserAccountInfo) throws -> PushSubscription {
|
|
|
|
throw Disabled()
|
|
|
|
}
|
|
|
|
|
|
|
|
func removeSubscription(account: UserAccountInfo) {
|
|
|
|
}
|
|
|
|
|
2024-04-08 13:48:40 +00:00
|
|
|
func pushSubscription(account: UserAccountInfo) -> PushSubscription? {
|
|
|
|
nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func register(transactionID: UInt64) async throws -> PushProxyRegistration {
|
|
|
|
throw Disabled()
|
|
|
|
}
|
|
|
|
|
|
|
|
func unregister() async throws {
|
|
|
|
throw Disabled()
|
|
|
|
}
|
|
|
|
|
2024-04-09 16:35:00 +00:00
|
|
|
func updateIfNecessary(updateSubscription: @escaping (PushSubscription) async -> Bool) async {
|
2024-04-08 13:48:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func didRegisterForRemoteNotifications(deviceToken: Data) {
|
|
|
|
}
|
|
|
|
func didFailToRegisterForRemoteNotifications(error: any Error) {
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Disabled: LocalizedError {
|
|
|
|
var errorDescription: String? {
|
|
|
|
"Push notifications disabled"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|