chore(*) Add Analytics with TestLab documentation

Add docs about ignoring analytics in TestLab
This commit is contained in:
Elliot Hesp
2019-11-19 10:46:52 +00:00
committed by GitHub

View File

@@ -111,3 +111,17 @@ async function onSignOut() {
await analytics().resetAnalyticsData();
}
```
### Ignore analytics events when running in TestLab (Pre-launch report)
When submitting to the Google Play Store, analytics events are triggered while the app is being tested in TestLab in order to generate pre-launch reports. Typically you want to ignore those events, which you can achieve via the following utility functions:
```js
import firebase from '@react-native-firebase/app';
import '@react-native-firebase/analytics';
if (firebase.app().utils().isRunningInTestLab) {
firebase.analytics().setAnalyticsCollectionEnabled(false);
}
```