简体   繁体   中英

Firebase Crashlytics debug mode not send report in ios

in swift, how to send crash report only release mode?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

#if DEBUG
    Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(false)
#endif

    return true
}

is it right? ( https://firebase.google.com/docs/crashlytics/customize-crash-reports )

Add this to didFinishLaunchingWithOptions method in AppDelegate.

    #if DEBUG
    Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(false)
    Crashlytics.crashlytics().checkForUnsentReports { isUnsendExists in
        if isUnsendExists {
            Crashlytics.crashlytics().deleteUnsentReports()
        }
    }
    #else
    Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)
    #endif

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM