Firebase is back at Google I/O on May 10! Register now

Get started with Firebase Remote Config

Stay organized with collections Save and categorize content based on your preferences.


You can use Firebase Remote Config to define parameters in your app and update their values in the cloud, allowing you to modify the appearance and behavior of your app without distributing an app update.

The Remote Config library is used to store in-app default parameter values, fetch updated parameter values from the Remote Config backend, and control when fetched values are made available to your app. To learn more, see Remote Config loading strategies.

Step 1: Add Firebase to your app

Before you can use Remote Config, you need to:

  • Register your C++ project and configure it to use Firebase.

    If your C++ project already uses Firebase, then it's already registered and configured for Firebase.

  • Add the Firebase C++ SDK to your C++ project.

Note that adding Firebase to your C++ project involves tasks both in the Firebase console and in your open C++ project (for example, you download Firebase config files from the console, then move them into your C++ project).

Step 2: Add Remote Config to your app

Android

After you've added Firebase to your app:

  1. Create a Firebase App, passing in the JNI environment and Activity:

    app = ::firebase::App::Create(::firebase::AppOptions(), jni_env, activity);

  2. Initialize the Remote Config library, as shown:

    ::firebase::remote_config::Initialize(app);

iOS+

After you've added Firebase to your app:

  1. Create a Firebase App:

    app = ::firebase::App::Create(::firebase::AppOptions());

  2. Initialize the Remote Config library, as shown:

    ::firebase::remote_config::Initialize(app);

Step 3: Set in-app default parameter values

You can set in-app default parameter values in the Remote Config object, so that your app behaves as intended before it connects to the Remote Config backend, and so that default values are available if none are set on the backend.

  1. Define a set of parameter names, and default parameter values using a std::map<const char*, const char*> object or a std::map<const char*, firebase::Variant> object.

    If you have already configured Remote Config backend parameter values, you can download a file that contains these key/value pairs and use it to construct your map object. For more information, see Download Remote Config template defaults.

  2. Add these values to the Remote Config object using SetDefaults().

Step 4: Get parameter values to use in your app

Now you can get parameter values from the Remote Config object. If you set values in the Remote Config backend, fetched them, and then activated them, those values are available to your app. Otherwise, you get the in-app parameter values configured using SetDefaults().

To get these values, call the method listed below that maps to the data type expected by your app, providing the parameter key as an argument:

Step 5: Connect your app in the Firebase console

In the Firebase console, add your app to your Firebase project.

Step 6: Set parameter values

  1. In the Firebase console, open your project.
  2. Select Remote Config from the menu to view the Remote Config dashboard.
  3. 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 conditional values. To learn more, see Remote Config parameters and conditions.

Step 7: Fetch and activate values

  1. To fetch parameter values from the Remote Config backend, call the Fetch() method. Any values that you set on the backend are fetched and cached in the Remote Config object.
  2. To make fetched parameter values available to your app, call the ActivateFetched()

Next steps

If you haven't already, explore the Remote Config use cases, and take a look at some of the key concepts and advanced strategies documentation, including: