Created
October 13, 2019 14:35
-
-
Save harshabhadra/17cc39d63ba2992c6d141ec1782f5cea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fetch a welcome message from the Remote Config service, and then activate it. | |
*/ | |
private void fetchWelcome() { | |
mWelcomeTextView.setText(mFirebaseRemoteConfig.getString(LOADING_PHRASE_CONFIG_KEY)); | |
// [START fetch_config_with_callback] | |
mFirebaseRemoteConfig.fetchAndActivate() | |
.addOnCompleteListener(this, new OnCompleteListener<Boolean>() { | |
@Override | |
public void onComplete(@NonNull Task<Boolean> task) { | |
if (task.isSuccessful()) { | |
boolean updated = task.getResult(); | |
Log.e(TAG, "Config params updated: " + updated); | |
} else { | |
Toast.makeText(MainActivity.this, "Fetch failed", | |
Toast.LENGTH_SHORT).show(); | |
} | |
displayWelcomeMessage(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment