15

The Firebase Remote Config App version condition seems to be ignored. I've made the following setup to play around with my current development version:

xCode Version setup: enter image description here

Firebase Remote Config Condition setup: enter image description here

FIRRemoteConfig won't return the right paramater values.

Community
  • 1
  • 1
stsandro
  • 313
  • 2
  • 8
  • does the App ID check work at all in the first place? it doesn't seem so for me. – Hogdotmac Feb 06 '19 at 10:19
  • As far as I can tell is the App ID check working as supposed. I'm having a free and a PRO version of my app and it has different Remote Config values – stsandro Feb 06 '19 at 16:17

6 Answers6

12

Its known bug - instead of version value FB uses the build value. The only possible workaround - to put the same value to build. So in your case it should be like "version: 1.1.8" and "build: 1.1.8". Or you could use the build value and keep the value updated with every app release.

Stan
  • 6,121
  • 8
  • 48
  • 85
4

Another option is you can add a "User Property" in Firebase like "app_version". Then when the app launches add the following code:

let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String Analytics.setUserProperty(version, forName: "app_version")

You can then use this User Property in Remote Config as a condition and voila you can base some Remote Config value of of the version number. Note this will require the use of Firebase Analytics as well.

Adding user property Firebase

SchmidtyApps
  • 137
  • 1
  • 4
2

It should work. In fact you have to use the build as version. The problem can be the cache or the "Publish Changes"

alessionossa
  • 932
  • 1
  • 13
  • 34
2

From the documentation of Firebase remote config it says that AppVersion is the app's CFBundleVersion. You are using build number as AppVersion. For an app, it may contain same build number for multiple app versions. Try to change your condition and check it.

Kirish
  • 41
  • 5
  • 1
    version corresponds to CFBundleShortVersionString and build corresponds to CFBundleVersion. according to firebase documentation CFBundleVersion is used, but in actuality neither works. – Hogdotmac Feb 06 '19 at 10:11
1

You are using the correct app version.

Try setting your expiration duration to 0 so you get a fresh fetch. Also make sure your fetch is not throttled that you are getting the cache result from previous successful fetch.

Chen Liang
  • 152
  • 3
  • 3
    It is not working. I'm getting a fresh fetch. I've put a breakpoint where the fetch is activated and looked up the value that should be different in this version, but it wasn't. Something is not working right here. – stsandro Aug 03 '16 at 13:30
0

FireBase now allow specifying CFBundleShortVersionString as APP version from Firebase iOS SDK version 6.24.0 or above. Please refer https://firebase.google.com/docs/remote-config/parameters