Sam King 1 год назад
Родитель
Сommit
e8ebc1aae8
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      Trio/Sources/Application/AppDelegate.swift

+ 4 - 4
Trio/Sources/Application/AppDelegate.swift

@@ -12,13 +12,13 @@ class AppDelegate: NSObject, UIApplicationDelegate, ObservableObject, UNUserNoti
         FirebaseApp.configure()
         FirebaseApp.configure()
 
 
         let userDefaults = UserDefaults.standard
         let userDefaults = UserDefaults.standard
-        // will default to `false` if the key doesn't exist
-        let crashReportingOptOut = userDefaults.bool(forKey: "crashReportingOptOut")
-
+        // Default to `true` if the key doesn't exist
+        let crashReportingEnabled: Bool = userDefaults.getValue(Bool.self, forKey: "DiagnosticsSharing") ?? true
+        
         // The docs say that changes to this don't take effect until
         // The docs say that changes to this don't take effect until
         // the next app boot, but this is fine since the app will need
         // the next app boot, but this is fine since the app will need
         // to boot after a crash
         // to boot after a crash
-        Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(!crashReportingOptOut)
+        Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(crashReportingEnabled)
         
         
         return true
         return true
     }
     }