Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable particular feature in android app for specified users based on city using A/B Testing

I want to enable particular feature based on user signed up city (Not based on user current geo location) in my android app.

I am able to get single city with key from Firebase Remote Config.But how do I map multiple cities with a single key so that I can a enable feature for those cities?

Will firebase remote config will help my requirement? If not, please suggest a tool which will meet my requirement.

Please find following snippet which I am trying using firebase-remote-config

//Here I am able to get single city only.
String enableCity = mFirebaseRemoteConfig.getString(ENABLE_CITY);

//lets take user city is Bangalore
if ("Bangalore".equalsIgnoreCase(enableCity)) {
       //enable feature
}

Here I want to get list of enabled cities which are updated from remote config to enable feature.

like image 288
raghu Avatar asked Oct 14 '25 23:10

raghu


1 Answers

Firebase Remote Config allows you to define user regions or countries on the server side, but not cities as far as I can tell.

In order to setup a parameter to be enabled for certain countries, you need to set it up on the server.

Head to the remote config section on the server and create a custom condition that targets the certain countries for that feature: create firebase remote config for region

Then once you have created the conditional for your countries, use it within a parameter like below: using region conditional for parameter

This will then allow you to enable the feature for certain region/countries.

Unfortunately the above won't work for cities. With regards to mapping certain cities, what you can do is set a custom user property to the users current city (perhaps if they choose it from a drop down or if you can get their city from location data?) and then create a conditional that is based on the users city as we did above. Using User properties to conditionally split audiences

like image 86
riggaroo Avatar answered Oct 17 '25 12:10

riggaroo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!