From b4693252bed55e5c6fab0aaf4daad6915f9c5f68 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 31 Mar 2024 12:52:56 -0400 Subject: [PATCH] Fix how we're getting the Sentry installation ID --- Tusker/AppDelegate.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tusker/AppDelegate.swift b/Tusker/AppDelegate.swift index 0139e52369..fb9cba5800 100644 --- a/Tusker/AppDelegate.swift +++ b/Tusker/AppDelegate.swift @@ -123,12 +123,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { event.context?.removeValue(forKey: "culture") return Preferences.shared.reportErrorsAutomatically ? event : nil } - } - - if let clazz = NSClassFromString("SentryInstallation"), - let objClazz = clazz as AnyObject as? NSObject, - let id = objClazz.value(forKey: "id") as? String { - logger.info("Initialized Sentry with installation/user ID: \(id, privacy: .public)") + + if let clazz = NSClassFromString("SentryInstallation"), + let objClazz = clazz as AnyObject as? NSObject, + let id = objClazz.perform(Selector(("idWithCacheDirectoryPath:")), with: options.cacheDirectoryPath).takeUnretainedValue() as? String { + logger.info("Initialized Sentry with installation/user ID: \(id, privacy: .public)") + } } } #endif