1

I've kept myself from using Firebase Analytics and Crash Reports because there was no way of disabling Crash Reporting.

I've seen the answers on other questions but not offered a proper way of doing it.

I've read an interesting thing on Firebase blog: https://firebase.googleblog.com/2017/03/take-control-of-your-firebase-init-on.html

I wonder, could this be used do disable analytics and crash reporting? I mean, heaving something like:

if (user.wantsAnalytics()){
    FirebaseApp.initializeApp(this, builder.build());
}else{
 //do nothing and no analytics or crash reports will be sent.
}

If firebase isn't initialized, would push messaging still work?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Alin
  • 14,809
  • 40
  • 129
  • 218
  • There's currently no way to disable only Firebase Crash Reporting separately from other Firebase features. That functionality is being worked on, so please stay tuned for future updates. – Doug Stevenson Mar 29 '17 at 12:43
  • @DougStevenson thank you for your comment. Can you please confirm that by not doing initialize() the Firebase won't be loaded/used at all? From what I see, this would allow me to disable both Analytics and Crash Reporting in this way... if the user opts out. – Alin Mar 29 '17 at 18:51
  • You have to allow FirebaseApp to initialize in order to use any of the SDKs. Normally this is called automatically for you by a ContentProvider that's added to your app. https://firebase.googleblog.com/2016/12/how-does-firebase-initialize-on-android.html – Doug Stevenson Mar 29 '17 at 18:57

0 Answers0