Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase remote config cache expiration time in release

I'm trying to setup firebase remote config for release mode by setting developer mode to false. But with cache expiration time less then 3000(may be a bit less, determined it experimentally) seconds, it fails to fetch data. It throws FirebaseRemoteConfigFetchThrottledException

FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
                        .setDeveloperModeEnabled(false)
                        .build();

And with .setDeveloperModeEnabled(true) it allows me to set any time even 0 and works well.

Here is whole hunk:

new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
            FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
                    .setDeveloperModeEnabled(false)
                    .build();

            mFirebaseRemoteConfig.setConfigSettings(configSettings);
            mFirebaseRemoteConfig.setDefaults(R.xml.remote_config_defaults);

            mFirebaseRemoteConfig.fetch(CACHE_EXPIRATION)
                    .addOnSuccessListener(new OnSuccessListener<Void>() {
                        @Override
                        public void onSuccess(Void aVoid) {
                            Log.i("info32", "remote config succeeded");
                            mFirebaseRemoteConfig.activateFetched();
                        }
                    })
                    .addOnFailureListener(new OnFailureListener() {
                        @Override
                        public void onFailure(@NonNull Exception exception) {
                            Log.i("info32", "remote config failed");
                        }
                    });
        }
    }, 0);

Could you please explain what the issue is?

like image 295
YTerle Avatar asked Jul 28 '16 10:07

YTerle


People also ask

How can I reduce the time the firebase cache expires?

If you have used Firebase Remote Config, you probably have read from the documentation the below statement, and wonder if you could reduce the time By default the cache expires after 12 hours, but you can change the cache expiration for a specific fetch by passing the desired cache expiration to the fetch method

How do I create a firebase remote configuration?

This can be done by navigating to the Firebase console > Remote Config and clicking on "Create configuration" if it's your first time using Remote Config, or "Add parameter" if you already have some created. This will open up the parameter editor as shown below. 2. Set a primary objective

How do I change the default value of a firebase parameter?

In the Firebase console, open your project. Select Remote Config from the menu to view the Remote Config dashboard. Define parameters with the same names as the parameters that you defined in your app. For each parameter, you can set a default value (which will eventually override the in-app default value) and you can also set conditional values.

How do I override in-app default values in Firebase?

To override in-app default values, you use the Firebase console or the Remote Config backend APIs to create parameters with the same names as the parameters used in your app.


1 Answers

Remote Config implements client-side throttling to prevent buggy or malicious clients from blasting the Firebase servers with high frequency fetch requests. One user has reported the limit is five requests per hour. I haven't found the limit documented anywhere, although I have confirmed that five rapid fetches will activate throttling.

The caching of configuration values is explained in the documentation. Because of the throttling limits, it is not possible for your released app to immediately see changes in Remote Config values. Cached values will be used until the next fetch is allowed. The default cache expiration is 12 hours.

like image 174
Bob Snyder Avatar answered Sep 28 '22 12:09

Bob Snyder