firebasereact-nativefirebase-remote-config

remoteConfig().getAll() return undefined is not an object (evaluating 'Object.keys(this._values)')


import remoteConfig from '@react-native-firebase/remote-config';

useEffect(() => {
getConfig()
.then(res => console.log(res)
.catch(err => console.log(err.message))
}, [])

const getConfig = async () => {
const firebase = await remoteConfig().getAll();
return firebase
}

It return undefined is not an object (evaluating 'Object.keys(this._values)')


Solution

  • you need to fetchAndActivate the remote config before you can use it. I tested it with your code and it worked afterward