Firebase Remote Config

Firebase

I. Overview

Firebase Remote Config is a Firebase service that helps you manage and update your app's configuration without the need to release a new version on the app store. It allows you to adjust configuration values from the Firebase Console and deliver them to users' apps flexibly.

Here are some key points about Firebase Remote Config:

Dynamic Configuration Updates:

User Classification:

Trigger Conditions:

Integrations:

Security and Safety:

Firebase Remote Config is commonly used to adjust app features, settings, and user experiences without having to release a new version. This is particularly useful when you want to test and optimize your app in real-time.

II. How does Firebase Remote Config work?

1. Fetch và Active

Firebase Remote Config operates based on a mechanism of fetching and updating configuration data from the Firebase server and synchronizing it with the user's mobile app through the provided SDK.

Fetch data from Firebase server:

Cache

In case you call the fetch function when the expiration time has not elapsed, Firebase Remote Config will check whether enough time has passed between fetches. If the time between fetches is not sufficient, it will return the data from the cache memory without making a call to the Firebase server to retrieve new data.

Use:

Automatic Data Update:

This process helps streamline the configuration update workflow of the application, reducing the time required to apply changes. Both the fetch and cache storage processes are performed to ensure performance and synchronization.

2. Real-time configuration

Firebase Remote Config provides the ability to update app configurations in real-time through several flexible features. When you configure Firebase Remote Config for real-time updates, there are some differences compared to the usual approach. Here are some distinctions when you use the real-time update feature:

Instant Updates:

Automatic Polling:

III. Demo with Flutter

Create a new Firebase Demo project:

At https://console.firebase.google.com/, log in to your account and create a new project.

Add iOS and Android apps accordingly, then download the configuration file and copy it into the project.

Add lib

Initialize at the main

Android:

Add: apply plugin: 'com.google.gms.google-services'

and: classpath 'com.google.gms:google-services:4.3.13'

Access the console and create configuration

Publish change, the data on Remote Config is now ready

1. fetch and active

Set up the remote and retrieve the results in the code, run debug, and check the data. We observe that remoteConfig.getAll() returns a Map containing keys and values:

2. Real-time configuration

Utilize remoteConfig.onConfigUpdated.listen to listen for configuration change events. On the console, perform data updates and publish the changes. After publishing, we capture the changes in the event as follows: