and-nd-firebase
and-nd-firebase copied to clipboard
FirebaseRemoteConfig.activateFetched(); is deprecated
the 'activateFetched()' method is deprecated; what should I use now?
try FIRRemoteConfig.remoteConfig().activateFetched()
See https://firebase.google.com/docs/reference/android/com/google/firebase/remoteconfig/FirebaseRemoteConfig.html#activateFetched():
public boolean activateFetched ()
This method is deprecated. Use activate() instead.
Activates the most recently fetched configs, so that the fetched key value pairs take effect.
fetched first time, if call activate(), the value is null . What's wrong? Here is my code:
firebaseRemoteConfig.fetch(0L)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
// firebaseRemoteConfig.activateFetched();
firebaseRemoteConfig.activate();
//parse config
String json = firebaseRemoteConfig.getString(Constants.REMOTE_CONFING_KEY);
}
}
}
@LazyBonesLZ, I tried 0L as an interval, but ended with 3600L. If I don't mind, in case of 0L onComplete
won't be called sometimes.