react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

Remote Config does not work...

Open nica0012 opened this issue 3 years ago • 0 comments
trafficstars

No matter what I try, it seems like it is not possible to fetch values from the console with firebase remote config.

I am, "connected" but no values are being fetched besides the default values I have set.

//Package JSON
"react-native": "0.66.0",
"@react-native-firebase/app": "^14.11.1",
"@react-native-firebase/remote-config": "^14.11.1",

Here is my code which is executed on app load:

async componentDidMount() {
   const appVersion = DeviceInfo.getVersion();

   await remoteConfig().setConfigSettings({
     minimumFetchIntervalMillis: 30000,
   });

   await remoteConfig()
     .setDefaults({
       is_application_on: true,
       min_app_version: appVersion
     })
     .then(() => remoteConfig().fetchAndActivate())
     .then((fetchedRemotely) => {});

     let isAppOn = remoteConfig().getBoolean('is_application_on');
     let appMinVersion = remoteConfig().getNumber('min_app_version');

     this.setState({
       isAppOn: isAppOn ? true : false
     }, () => {
       alert(this.state.isAppOn)
       alert(appMinVersion)
     })
}

My firebase is connected but remote config is the only module I cannot seem to connect to...

nica0012 avatar Sep 15 '22 13:09 nica0012