Firebase Remote Config Overlapping Condition Groups

Viewed 2066

I'm working with Firebase Remote Config and wondering what happens behind the scenes when you have overlapping conditions for a firebase parameter. For example, say I have two conditions for a parameter:

  1. If the user is on an Android device, return true.
  2. If the user is on an Android device, and the device is a Samsung, return false.

What would Firebase return for this parameter if the user was querying from a Samsung device? Presumably, it would depend on which condition Firebase checks first. This is just the tip of the iceberg, and it stems from Firebase not supporting and operators on condition expressions. For example, in order to avoid the overlap, and only wanted Samsung devices to return false, I would need to create a separate condition for every possible Android device, and return true (If Google device: return true, If Huawei: return true, If Motorolla: return true), since I couldn't have just one condition that says If device is Google OR Huawei OR Motorolla OR ....

Is there a way to at least enforce the order in which Firebase Remote Config values are checked?

1 Answers

When conditions overlap then the order of the conditions matters - the first condition evaluated to true will stop evaluation and value for that condition will be taken.

As described in the docs:

If multiple conditions evaluate to true, the first (top) one shown in the Firebase console UI takes precedence, and conditional values associated with that condition are provided when an app fetches values from the backend. You can change the priority of conditions by dragging and dropping conditions in the Conditions tab.

If you want to build complex conditions then you can also use audience as a condition - audience builder is more flexible tool for connecting a few properties.

Related