1

I create a Firebase A/B testing, and add a condition by UserProperty(eg: gender=male). When I change the condition (eg: gender=famale) and reset config cache with reset API, then fetchAndActive and call the getConfig function, value is still the previous value.

PS: Except clear data for this App, the config is always cache. I have a try with pure remote config and a user property condition, the same thing didn't happen.

Is reset API not working for A/B testing? how can I clear it.

Sample code:

    // 1. fetch the male config
    Firebase.analytics.setUserProperty("user_gender", "male")
    config.fetchAndActivate().addOnCompleteListener {
        val config = config.getString("test_by_gender")
        showText("fetchMaleConfig: $config(task success=${it.isSuccessful})")
        // will show male config
    }

    // 2. reset config
    config.reset()

    // 3. fetch the female config
    Firebase.analytics.setUserProperty("user_gender", "female")
    config.fetchAndActivate().addOnCompleteListener {
        val config = config.getString("test_by_gender")
        showText("fetchFemaleConfig: $config(task success=${it.isSuccessful})")
        // will show male config too
    }

My A/B testing config screenshot:

A/B Testing config screenshot

twiceYuan
  • 863
  • 8
  • 11
  • Find a solution: call the function `FirebaseInstallations.getInstance().delete()`, it can meet my needs, but I'm not sure it's a normally solution. – twiceYuan Sep 04 '22 at 13:39

0 Answers0