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-11 16:58:43 +00:00
|
|
|
var subscriptions: [PushSubscription] {
|
|
|
|
[]
|
|
|
|
}
|
|
|
|
|
2024-04-08 16:25:39 +00:00
|
|
|
func createSubscription(account: UserAccountInfo) throws -> PushSubscription {
|
|
|
|
throw Disabled()
|
|
|
|
}
|
|
|
|
|
|
|
|
func removeSubscription(account: UserAccountInfo) {
|
|
|
|
}
|
|
|
|
|
2024-04-10 01:07:14 +00:00
|
|
|
func updateSubscription(account: UserAccountInfo, alerts: PushSubscription.Alerts, policy: PushSubscription.Policy) {
|
|
|
|
}
|
|
|
|
|
2024-04-08 13:48:40 +00:00
|
|
|
func pushSubscription(account: UserAccountInfo) -> PushSubscription? {
|
|
|
|
nil
|
|
|
|
}
|
|
|
|
|
2024-04-11 15:55:56 +00:00
|
|
|
func register() async throws -> PushProxyRegistration {
|
2024-04-08 13:48:40 +00:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|