# Create the parameters of the app in Firebase Remote Config

The step `firebase_remote_config.parameters`, for [`firebase_remote_config`](https://doc.saymyframe.com/modules/firebase-remote-config.md).

The app reads values of remote config, such as the lowest version of the app that may run, from Firebase Remote Config. Each parameter has a default in the app, which it reads while the Firebase project gives none. So the app runs before this step, and the parameters take effect once you create them in the project.

No command can add a parameter to the Remote Config of a project without replacing what you set there, so this step is yours. The app lists it only once a module of the app reads a parameter, such as [`update_required`](https://doc.saymyframe.com/modules/update-required.md).

Remote Config belongs to the Firebase project. If your [flavors](https://doc.saymyframe.com/guides/flavors.md) have Firebase projects of their own, repeat this in each project that needs it.

**1. Find the parameters of your app.** The section "Remote config" of the README of the app lists them, each with its name, its type, its default and what it is for, such as:

```text
- `update_required_minimum_version`, a text read as `updateRequiredMinimumVersion`, by default empty, from the module `update_required`: The lowest version of the app that may run, such as 1.4.0; empty for none
```

The default there is what the app reads while the project gives none. `RemoteValues.defaults` in `lib/core/remote_config/remote_values.dart` has the same.

**2. Add each parameter.** In the [Firebase console](https://console.firebase.google.com/), open the project of the flavor, and open Remote Config. Add each parameter with the name, the type and the default that the README lists, and the text after the colon of its line as the description of the parameter. The name has to be the same, letter for letter, and the type has to fit the type of the parameter in the app. A value that the type does not take, such as `abc` for a number, reads as the default of the app, and a debug build says so.

A value that differs by platform, such as one for Android and one for iOS, gets a condition of the platform in the console.

**3. Publish the changes.** A value that you publish reaches an app that runs through the real-time updates of Firebase, and an app that starts later with its next fetch.

**4. Check the APIs of the project.** The app needs two APIs of Google in the project:

- the Firebase Remote Config API (`firebaseremoteconfig.googleapis.com`), for its fetches;
- the Firebase Remote Config Realtime API (`firebaseremoteconfigrealtime.googleapis.com`), for the values that you publish while it runs. It answers 403 while it is disabled.

If the API keys of the Android and iOS apps of the project have API restrictions, in the Google Cloud console under **APIs & Services**, **Credentials**, each key must allow both APIs, or the fetches and the real-time updates of the app fail.

**Check.** Run a debug build of the app, which asks Firebase for new values at each start and each time you come back to it. Publish another value of a parameter in the console: the running app gets it through the real-time updates, without a new start. With `update_required`, a lowest version above the version of the app shows the screen "Update required" in place of the app, on Android, and on iOS once `.env` has the App Store ID of the app. An empty one takes the screen away again.
