Home > Mobile >  Firebase parameter going to default value if conditional value set
Firebase parameter going to default value if conditional value set

Time:08-13

Not sure if someone else came across a similar issue before. When I create a remote config parameter and choose it as a boolean with no conditional values. In my iOS project, firebase can read it correctly. However, when I start using conditional statements, where it is checking if the user is in a particular location e.g. UK in the image below.

Creating a new condittion

When setting up this param, I did the following:

Creating new param

Every time I am accessing the “test_country” parameter, it is showing me the default value of false, rather then the expected “true”. I looked through different questions on stack overflow and set

configSettings.minimumFetchInterval = 60

in debug mode to fetch quicker then the recommended 12 hours in production and ever tried another stack overflow recommendation of setting the

remoteConfig.fetch(withExpirationDuration: 0)

to zero,  to force fetch from remote . Just to ensure its not a fetching issue.

Any suggestion what could be going wrong? I'm not sure what more information is needed to help in this case, please let me know.

I've looked through the following questions:

CodePudding user response:

This issue has been resolved. With the information I currently gave, it was probably going to be hard to deduce what went wrong. Apologies for anyone that read this question.

On to the answer. For my app we have a release build and a debug build. Only one firebase to manage them. So, for debug build, we normally turn off:

FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED

For more information on this see this link -> Configure Analytics data collection and usage

This needs to be turned on, in order for Google Analytics offers to control the collection and use Analytics data. Which I believe is required for conditional statements. Especially if the conditional statement is using a custom definition.

  • Related