As your app evolves, new releases can introduce breaking changes to backend
APIs, resolve critical security vulnerabilities, or replace deprecated
services and AI models. In these situations, earlier app versions can stop
functioning reliably or securely.

Using Remote Config, you can control app version requirements dynamically
from the cloud. By defining version parameters in Remote Config, you can
prompt or require users to update their app without deploying custom server
infrastructure or releasing an emergency update.

## Choose an update strategy

Remote Config supplies the version parameters to evaluate on the client,
letting you configure your app's update UI for either of two strategies
depending on the severity of the change:

- **Forced (blocking) update**: If an earlier app version is incompatible with your backend or poses a security risk, you can block access to the app until the user updates. When the installed version is earlier than the required minimum, you can configure your app to display a non-dismissible dialog that directs the user to the platform app store to install the latest version.
- **Flexible (optional) update**: If an update introduces new features, performance improvements, or minor bug fixes, you can configure your app to display a dismissible banner or prompt encouraging users to update at their convenience while letting them continue using the app.

## Step 1: Configure parameters in Firebase console

To manage app versions, define parameters in your Remote Config template:

1. In the Firebase console, go to the **DevOps \& Engagement** \> **Remote Config** \> [**Parameters** page](https://console.firebase.google.com/project/_/config).
2. Click **Add parameter** (or **Create configuration** if this is your first parameter).
3. Define the following parameters:
   - `minimum_version`: A string representing the earliest supported version of your app (for example, `"2.4.0"`). Apps running a version earlier than this value are blocked until updated.
   - `latest_version` *(optional)* : A string representing the latest available version of your app (for example, `"2.5.1"`). Apps running a version between `minimum_version` and `latest_version` can show an optional update recommendation.
   - `update_url` *(optional)*: The store URL where users can download the update (such as your Google Play Store or Apple App Store listing).
4. Optional: Add platform-specific conditions:
   - Because Android and Apple apps often use different release versions and store URLs, you can add conditional values for each platform under the same parameter.
   - Click **Add value for condition** \> **Create condition** . Name the condition (such as `Android App` or `iOS App`), select **App** as the targeting rule, and choose your app.
   - Set the appropriate version string for each platform condition, and keep the default value as a fallback.
5. Click **Save** and then click **Publish changes** to apply the template.

## Step 2: Implement client-side version checks

On the client, check the installed app version against the Remote Config
parameters during startup:

1. **Set in-app default values** : Always provide safe in-app default values in your app bundle (for example, set `minimum_version` to your initial app release, such as `"1.0.0"`). This fallback configuration ensures that your app continues to operate normally if the device is offline or the initial fetch request fails. For platform-specific guidance, see [Download Remote Config template defaults](https://firebase.google.com/docs/remote-config/templates.md.txt#download_template_defaults).
2. **Fetch and activate Remote Config**: Fetch and activate the latest template values when your app starts.
3. **Compare versions** : Retrieve the active `minimum_version` and
   `latest_version` strings and compare them with the currently installed app
   version.

   > [!CAUTION]
   > **Caution:** Comparing version strings lexicographically can yield unexpected results (for example, the string `"1.10.0"` evaluates as less than the string `"1.2.0"`). Always parse version strings into integer components (major, minor, and patch) or use a dedicated semantic versioning library. Alternatively, you can track versions using integer build numbers or version codes (such as Android `versionCode` or Apple `CFBundleVersion`).

4. **Take action based on the version comparison**:

   - **Enforce required update** : If `current_version` is earlier than `minimum_version`, display a full-screen, non-dismissible modal alert. Disable navigation to the rest of the app and provide a button that opens the `update_url` in the platform app store.
   - **Prompt optional update** : If `current_version` is earlier than `latest_version`, display a dismissible dialog or notification letting users know that an update is available, with options to **Update now** or **Later**.
   - **Allow access**: Otherwise, allow the user to proceed into the app.

## Best practices

- **Add a real-time listener** : When version updates are required because of security issues or serious UX degradation, adding a [real-time Remote Config listener](https://firebase.google.com/docs/remote-config/ios/real-time.md.txt) to your app can help ensure that version requirement changes take effect immediately on active devices without waiting for the next scheduled fetch or app restart.
- **Test with a limited testing group** : Before raising the `minimum_version` for all production users, test the condition with a [limited testing group](https://firebase.google.com/docs/remote-config/use-cases/limited-testing-group.md.txt) or target internal testers by using custom user properties. This testing verifies that the blocking modal displays correctly and that the store links resolve properly.
- **Use platform in-app update APIs** : On Android, consider integrating [Google Play In-App Updates](https://developer.android.com/guide/playcore/in-app-updates) alongside your Remote Config checks to let users download and install updates without leaving your app.
- **Read production checklists** : Read the [Firebase launch checklist](https://firebase.google.com/support/guides/launch-checklist.md.txt#remote-config) and [AI Logic production checklist](https://firebase.google.com/docs/ai-logic/production-checklist.md.txt) for more guidance on preparing your app and AI features for production.