I would like to provide a setting in my Android app's settings activity allowing the user to disable our use of analytics software, including Crashlytics. However, Crashlytics.start(Context)
is called long before the user gets to the settings page, and I don't see an equivalent Crashlytics.stop(Context)
function. Is it possible to stop Crashlytics within the app after it has been started?
Each user would need to head to their Firebase console and click on the Alert tab or use this link: https://firebase.google.com/u/0/subscriptions/overview Select the project and then turn off emails for Crashlytics.
To opt out of automatic crash reporting, pass false as the override value. When set to false, the new value does not apply until the next run of the app. To disable the crash logs while in debug mode you must pass ! BuildConfig.
Here's a couple of ways to disable Crashlytics while you are doing your debug builds! Use a different android:versionString for debug and release builds and then disable crash reporting from the Crashlytics web dashboard for the debug version. Wrap the call to Crashlytics.
Enable debug logging for CrashlyticsSelect Run from the left menu, then select the Arguments tab. In the Arguments Passed on Launch section, add -FIRDebugEnabled .
I've been informed that the specific case I'm attempting is not currently possible. However, I can give users control over whether or not to send data to Crashlytics by enabling the "Privacy prompt" in the App settings part of the Crashlytics dashboard:
Go here to select the app you want to add the dialog to and then click on "Enable Privacy Prompt" in the top left corner.
from: https://docs.fabric.io/android/crashlytics/advanced-setup.html#using-the-privacy-dialog
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With