forked from shadowfacts/Tusker
Don't use Sentry in PushNotifications package
This commit is contained in:
parent
e150856e91
commit
840b83012a
|
@ -7,9 +7,6 @@
|
|||
|
||||
import Foundation
|
||||
import OSLog
|
||||
#if canImport(Sentry)
|
||||
import Sentry
|
||||
#endif
|
||||
import Pachyderm
|
||||
import UserAccounts
|
||||
|
||||
|
@ -18,6 +15,9 @@ public struct PushManager {
|
|||
public static let shared = createPushManager()
|
||||
|
||||
public static let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "PushManager")
|
||||
|
||||
@MainActor
|
||||
public static var captureError: ((any Error) -> Void)?
|
||||
|
||||
private init() {}
|
||||
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
|
||||
import UIKit
|
||||
import UserAccounts
|
||||
#if canImport(Sentry)
|
||||
import Sentry
|
||||
#endif
|
||||
import CryptoKit
|
||||
|
||||
class PushManagerImpl: _PushManager {
|
||||
|
@ -150,9 +147,7 @@ class PushManagerImpl: _PushManager {
|
|||
}
|
||||
} catch {
|
||||
PushManager.logger.error("Failed to update push registration: \(String(describing: error), privacy: .public)")
|
||||
#if canImport(Sentry)
|
||||
SentrySDK.capture(error: error)
|
||||
#endif
|
||||
PushManager.captureError?(error)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||
BackgroundManager.shared.registerHandlers()
|
||||
|
||||
Task {
|
||||
PushManager.captureError = { SentrySDK.capture(error: $0) }
|
||||
await PushManager.shared.updateIfNecessary()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue