Firebase崩溃报告如何初始化 [英] How does Firebase crash reporting initialize

查看:173
本文介绍了Firebase崩溃报告如何初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



  

我非常好奇如何在应用程序中编写0代码,所需要的只是使用库> compile'c​​om.google.firebase:firebase-crash:9.0.1'

为了得到Firebase崩溃报告工作。
初始化总是一次性的,比如应用程序类'onCreate总是被调用一次吗?'

如果我想启用崩溃仅在某个事件发生后才报告?更新:现在有一篇关于 Firebase组件如何初始化

Firebase崩溃报告(除了其他Firebase组件)在包含在您的应用程序中的ContentProvider中自动初始化。 ContentProviders首先被实例化,然后是你的Application子类,然后被调用的任何组件(Activity,Service,BroadcastReciever)。
$ b 当你的项目依赖于一个Android库项目(aar文件),所有的清单条目都被合并到你的应用程序中,所以你可以免费得到这个ContentProvider,只需要声明声明firebase的崩溃依赖关系即可。



在谷歌I / O 2016关于这一切如何工作。 跳转到16:22 以查看崩溃报告的具体内容。



不幸的是,目前没有办法以编程方式启用或禁用崩溃报告,但即将到来。


I'm extremely curious how there is 0 code written within the application and all that is required is to use the library

compile 'com.google.firebase:firebase-crash:9.0.1'

in order to get firebase crash reporting working. Is the initialization always a one time thing like how the application class' onCreate is always called just once?

What do I do if i want to enable crash reporting only after a certain event?

解决方案

Update: There is now a comprehensive blog post about how Firebase components initialize.

Firebase Crash Reporting (in addition to other Firebase components) initialize in a ContentProvider that's included into your app automatically. ContentProviders are instantiated first, then your Application subclass, then whatever component was invoked (Activity, Service, BroadcastReciever).

When your project depends on an Android Library project (aar file), all of its manifest entries are merged into your app, so you get this ContentProvider for free simply by declaring declaring the dependency on firebase-crash.

I gave a talk at Google I/O 2016 about how this all works. Jump to 16:22 for the beginning of the content specific to crash reporting.

Unfortunately there is currently no way to programmatically enable or disable crash reporting, but that is coming soon.

这篇关于Firebase崩溃报告如何初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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