and-nd-firebase icon indicating copy to clipboard operation
and-nd-firebase copied to clipboard

FirebaseRemoteConfig.activateFetched(); is deprecated

Open jwq199497 opened this issue 5 years ago • 4 comments

the 'activateFetched()' method is deprecated; what should I use now?

jwq199497 avatar Apr 13 '19 04:04 jwq199497

try FIRRemoteConfig.remoteConfig().activateFetched()

morphran avatar Apr 23 '19 11:04 morphran

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.

CoolMind avatar May 16 '19 08:05 CoolMind

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 avatar Sep 16 '19 07:09 LazyBonesLZ

@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.

CoolMind avatar Sep 17 '19 15:09 CoolMind