如何在应用程序在调试时运行时禁用Firebase崩溃报告? [英] How to disable Firebase Crash Reporting when the app is running on debug?

查看:189
本文介绍了如何在应用程序在调试时运行时禁用Firebase崩溃报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功实施了Firebase崩溃报告功能,但是为了避免在开发过程中出现非实际的崩溃情况,我们需要在应用运行时撤消调试Build Variant,以禁用该服务。



官方文档没有提到这方面的内容。

解决方案

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.

这篇关于如何在应用程序在调试时运行时禁用Firebase崩溃报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆