Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Firebase in development mode in Android

Tags:

I am using Firebase in my android project. Wanted to know how to disable it in development mode. All crashes and usage/events are being logged and messing up with actual analytics.

Any better way to disable this in development mode?

like image 753
Faisal Memon Avatar asked Sep 18 '16 14:09

Faisal Memon


People also ask

How do I remove Firebase from my Android phone?

Sign in to Firebase, then open your project. , then select Project settings. In the Your apps card, select the app that you want to delete. Under the Your apps card, click Remove this app.

How do I stop Firebase app indexing?

File -> Settings -> Plugins -> Firebase App Indexing -> uncheck. Restart Android Studio and it will be gone.


1 Answers

Checkout https://firebase.google.com/docs/analytics/configure-data-collection?platform=android

<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" /> 

To do this automatically add the following line to manifest:

 <meta-data         android:name="firebase_analytics_collection_deactivated"         android:value="@bool/FIREBASE_ANALYTICS_DEACTIVATED"/> 

Set different value of boolean for debug and release in your app/build.gradle

buildTypes {     debug {         resValue("bool", "FIREBASE_ANALYTICS_DEACTIVATED", "true")     }     release {         resValue("bool", "FIREBASE_ANALYTICS_DEACTIVATED", "false")     } } 
like image 52
kamalkishor1991 Avatar answered Oct 18 '22 06:10

kamalkishor1991