且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在应用程序在调试时运行时禁用Firebase崩溃报告?

更新时间:2023-10-22 22:38:46

UPDATED:
使用Google Play服务/ Firebase 11+,您现在可以在运行时禁用崩溃报告。 FirebaseCrash.setCrashCollectionEnabled()(感谢 @Tyler Carberry

老解答:

没有官方的支持,只要社区能够推测。我建议这样做的***方法是,在仪表板中设置多个Firebase应用程序,每个构建类型一个,并根据构建变体设置多个指向每个不同应用程序的google_services.json文件。


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-real crashes in the console during the development.

The official documentation doesn't say anything about this.

UPDATED: With Google Play Services / Firebase 11+ you could now disable crash reporting at runtime. FirebaseCrash.setCrashCollectionEnabled() (Thanks @Tyler Carberry)

OLD ANSWER:

There is no official support for this, as far as the community has been able to surmise. The best way I would suggest to do this is, set up multiple Firebase apps in your dashboard, one for each build type, and set up multiple google_services.json files directing to each different app depending on the build variant.