Firebase Remote Config App Version condition
Asked Answered
B

6

17

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.

Bongbongo answered 11/7, 2016 at 11:27 Comment(2)
does the App ID check work at all in the first place? it doesn't seem so for me.Beachhead
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 valuesBongbongo
A
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.

Aleuromancy answered 4/1, 2017 at 14:16 Comment(3)
Can you provide a link to the known bug if it's written somewhere that it's known...Plasterboard
When they gonna fix this? They should follow the Apple's structure.Simonton
Here's a link to the reported issue : github.com/firebase/firebase-ios-sdk/issues/3624Amena
H
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

Haughay answered 4/1, 2018 at 21:4 Comment(0)
C
2

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

Credent answered 15/9, 2016 at 20:7 Comment(0)
G
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.

Godesberg answered 19/12, 2016 at 5:30 Comment(1)
version corresponds to CFBundleShortVersionString and build corresponds to CFBundleVersion. according to firebase documentation CFBundleVersion is used, but in actuality neither works.Beachhead
G
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.

Gelid answered 18/7, 2016 at 18:27 Comment(1)
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.Bongbongo
A
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

Arabelle answered 13/10, 2020 at 10:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.