Firebase Remote Config

It helps to change the behavior and appearance of your app without publishing an app update, at no cost, for unlimited daily active users.

What is Firebase Remote Config?

Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your app without requiring users to download an app update. When using Remote Config, you create in-app default values that control the behavior and appearance of your app. Then, you can later use the Firebase console or the Remote Config REST API to override in-app default values for all app users or for segments of your user base. Your app controls when updates are applied, and it can frequently check for updates and apply them with a negligible impact on performance.

Add Firebase to your app

If you haven’t already, add Firebase to your Android project.

Add dependency

dependencies {
    // Import the BoM for the Firebase platform
    implementation platform('')

    // Add the dependencies for the Remote Config and Analytics libraries
    // When using the BoM, you don't specify versions in Firebase library dependencies
    implementation ''
    implementation ''

Demo App

I have prepared a Demo App for showing update dialog to the user.

Open Remote Config in Console, Add needed parameters and publish

Add default values

Create remote_config_defaults.xml file in res>xml folder

<?xml version="1.0" encoding="utf-8"?>
        <value>- test release note</value>
        <value></value>    <!--TODO : PLAY STORE URL-->

Fetch values from Firebase

val remoteConfig = FirebaseRemoteConfig.getInstance()
val configSettings = FirebaseRemoteConfigSettings.Builder()
val latestVersion = remoteConfig.getInt("latestVersion")
val forceUpdate = remoteConfig.getBoolean("forceUpdate")
val updateUrl = remoteConfig.getString("updateUrl")
val releaseNotes = remoteConfig.getString("releaseNotes")
Log.e("TAG", "latestVersion : $latestVersion")
Log.e("TAG", "forceUpdate : $forceUpdate")
Log.e("TAG", "updateUrl : $updateUrl")
Log.e("TAG", "releaseNotes : $releaseNotes")

Check current app version

val currentVersion = BuildConfig.VERSION_CODE

Show dialog if the version is different than the app version

val dialogUpdate = Dialog(this@MainActivity)
if (latestVersion > currentVersion) {
    dialogUpdate.tvReleaseNotes.text = releaseNotes
    dialogUpdate.btnUpdate.setOnClickListener {
        val intent = Intent(Intent.ACTION_VIEW) = Uri.parse(updateUrl)
    if (forceUpdate) {
        dialogUpdate.btnCancel.visibility = INVISIBLE
    } else {
        dialogUpdate.btnCancel.visibility = VISIBLE
    dialogUpdate.btnCancel.setOnClickListener {
} else {
    if (dialogUpdate.isShowing) {


Your contributions are welcome.

Leave a Comment