Created
October 13, 2019 14:48
-
-
Save harshabhadra/048d05b692d145ae46d4729cb2aa46f1 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
// [START display_welcome_message] | |
private void displayWelcomeMessage() { | |
// [START get_config_values] | |
String welcomeMessage = mFirebaseRemoteConfig.getString(WELCOME_MESSAGE_KEY); | |
String versionName = mFirebaseRemoteConfig.getString(VERSION_NAME_KEY); | |
if (versionName.equals(version) && mFirebaseRemoteConfig.getBoolean(CREATE_FORCE_UPDATE_DIALOG_KEY)) { | |
Log.e(TAG, "true"); | |
AlertDialog.Builder builder = new AlertDialog.Builder(this); | |
builder.setMessage(getResources().getString(R.string.dialog_message)); | |
builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialogInterface, int i) { | |
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(MY_APP_URL)); | |
startActivity(intent); | |
} | |
}); | |
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialogInterface, int i) { | |
finish(); | |
} | |
}); | |
builder.setCancelable(false); | |
AlertDialog dialog = builder.create(); | |
dialog.show(); | |
} else { | |
Log.e(TAG, "false"); | |
} | |
mWelcomeTextView.setText(welcomeMessage); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment