This is the code that I have:
final FirebaseRemoteConfig config = FirebaseRemoteConfig.getInstance();
FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder()
.setDeveloperModeEnabled(BuildConfig.DEBUG)
.build();
config.setConfigSettings(configSettings);
config.fetch(0).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
// After config data is successfully fetched, it must be activated before newly fetched
// values are returned.
config.activateFetched();
final String playStoreVersionCode = FirebaseRemoteConfig.getInstance().getString(
"android_latest_version_code");
} else {
Utils.appendLog("playStoreVersionCode Error fetching latest params ", "E", Constants.TIMELINE);
}
}
});
Now I want to increment my parameter, and I saw that from March there is a REST API in order to update parameters:
https://firebase.google.com/docs/remote-config/api-overview https://firebase.google.com/docs/remote-config/use-config-rest
But I don't really understand the tutorial. Why do I need to use curl? is this really necessary like in the use-config-rest link?
curl --compressed -D headers -H "Authorization: Bearer token" -X GET https://firebaseremoteconfig.googleapis.com/v1/projects/my-project-id/remoteConfig -o filename
And the quickstart just shows an example on how to fetch the data, not change it: https://github.com/firebase/quickstart-android/blob/master/config/app/src/main/java/com/google/samples/quickstart/config/MainActivity.java