How to disable Firebase Crash Reporting when the app is running on debug?

后端 未结 16 1407
谎友^
谎友^ 2020-12-04 13:42

I have successfully implemented Firebase Crash Reporting, but I need to disable the service when the app is running undo the \'debug\' Build Variant, in order to avoid non-r

16条回答
  •  一个人的身影
    2020-12-04 14:25

    For FirebaseAnalytics class.
    Disable collection: setAnalyticsCollectionEnabled(false);
    Enable collection: setAnalyticsCollectionEnabled(true); or write to AndroidManifest.xml in the application tag:

    Possible use:

    if (BuildConfig.DEBUG){ //disable for debug
        mFirebaseAnalytics.setAnalyticsCollectionEnabled(false);
    }
    

    Source

提交回复
热议问题