Search code examples
firebasereact-nativereact-native-firebasefirebase-remote-configfirebase-ab-testing

React Native Firebase AB-testing not showing correct data


We are struggling with a weird issue trying to implement AB-testing for React Native. Remote Config seems to work fine but in the AB-testing panel we don't see any data, we just get active users within the last 30 mins sometimes but it's quite infrequent. We did get one user exposed on Android but that just happened once. We are trying to deinstall the app and install it multiple times. Any ideas of what it can be? Posting some screenshots from the Firebase console as well as our code:

await remoteConfig().setDefaults({
  is_forum_first_tab: 'no',
});
await remoteConfig().fetchAndActivate();
await remoteConfig().setConfigSettings({
  isDeveloperModeEnabled: true,
  minimumFetchInterval: 0,
});
const isForumFirstTab = remoteConfig().getValue('is_forum_first_tab');
const { navigation } = this.props;
if (isForumFirstTab.asBoolean()) {
  navigation.navigate('AppV2');
} else {
  navigation.navigate('App');
}

package.json

"@react-native-firebase/analytics": "^10.6.0",
"@react-native-firebase/app": "^10.6.0",
"@react-native-firebase/auth": "^10.6.0",
"@react-native-firebase/crashlytics": "^10.6.0",
"@react-native-firebase/iid": "^10.6.0",
"@react-native-firebase/remote-config": "^10.6.0",

enter image description here

enter image description here


Solution

  • We solved it, a simple mistake on our side but I thought it might be useful for someone so I'll post it here. We had disabled analytics for all our environments but production and we were not testing in production:

    await firebase
            .analytics()
            .setAnalyticsCollectionEnabled(environment === 'production');