Tweak how Sentry installation ID is read

This commit is contained in:
Shadowfacts 2023-05-28 21:04:29 -07:00
parent f84694b809
commit 878744b636
1 changed files with 2 additions and 3 deletions

View File

@ -115,9 +115,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
} }
if let clazz = NSClassFromString("SentryInstallation"), if let clazz = NSClassFromString("SentryInstallation"),
let objClazz = clazz as AnyObject as? NSObjectProtocol, let objClazz = clazz as AnyObject as? NSObject,
objClazz.responds(to: Selector(("id"))), let id = objClazz.value(forKey: "id") as? String {
let id = objClazz.perform(Selector(("id"))).takeUnretainedValue() as? String {
logger.info("Initialized Sentry with installation/user ID: \(id, privacy: .public)") logger.info("Initialized Sentry with installation/user ID: \(id, privacy: .public)")
} }
} }