mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-21 19:11:34 +08:00
chore(*) Add Analytics with TestLab documentation
Add docs about ignoring analytics in TestLab
This commit is contained in:
@@ -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);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user