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