Search code examples
firebasefirebase-remote-config

How to define firebase-remote-config parameters based on app version


I need to distribute some settings based on the app version e.g. if app version equals "4.0.1" then a else b. I found the possibility to define a condition named "version" but the documentation says it is bound to the package name of the app and not the version or version code.

see here https://firebase.google.com/docs/remote-config/parameters

I tried it though specifying the app version through a "version" condition but it does not work. Any ideas on this would be much appreciated.


Solution

  • Creating a condition, which targets an app version via regular expression appears to be the only solution in this case.

    For my app I use the following configuration:

    Targeting version via regexp

    Here, users who have versions 1.8.* and below receive an alternate version of a backend configuration parameter.

    If you need to target only a specific version of the app, then a regular expression is not really necessary, so the approach that you took should work.

    Alternatively, you can have far more control if you create a user audience based on app version, and then target the audience.