import firebase from "react-native-firebase";
remoteKey = "testJSON"
firebase
.config()
.fetch(0)
.then(() => {
return firebase.config().activateFetched();
})
.then(activated => {
if (!activated) console.log("Fetched data not activated");
return firebase.config().getKeysByPrefix(remoteKey);
});
I am calling this inside App.js in my react native project, but it gives the error "fetch() operation cannot be completed ,due to throttling" What could be the issue ?
According to firebase documentation it means that config fetch was throttled https://firebase.google.com/docs/reference/ios/firebaseremoteconfig/api/reference/Enums/FIRRemoteConfigFetchStatus?hl=vi
The Remote Config library has a client-side throttle to ensure you don’t ping the service too frequently. By setting your fetchDuration to 0, you’ll hit this throttle and your library will stop making calls.
Try changing .fetch(0) to .fetch() or use the following function to activate development mode
func activateDebugMode() {
let debugSettings = FIRRemoteConfigSettings(developerModeEnabled: true)
FIRRemoteConfig.remoteConfig().configSettings = debugSettings!
}
and call it before.
import firebase from "react-native-firebase";
remoteKey = "testJSON";
firebase
.config()
.fetch()
.then(() => {
return firebase.config().activateFetched();
})
.then(activated => {
if (!activated) console.log("Fetched data not activated");
return firebase.config().getKeysByPrefix(remoteKey);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With