I integrated Firebase into my Android project, to get a different parameter value for different application user. I did the following:
- Setup users in my Firebase Project
- Created audiences to match the users: UIDs were AAAAAAA..., and BBBBBBB... accordingly.
- Created a parameter in Remote Config section:
- Added conditions for this parameter: and set values for the conditions:
Entered the following code to sign in the user from the application:
Task resultTask = firebaseAuth.signInWithEmailAndPassword("[email protected]", password);
- Made sure sign in was successful.
- Then I tried to fetch the remote config parameter:
firebaseRemoteConfig.fetch() .addOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(@NonNull Task task) { if (task.isSuccessful()) { // Once the config is successfully fetched it must be activated before newly fetched // values are returned. firebaseRemoteConfig.activateFetched(); Log.d(TAG, firebaseRemoteConfig.getString("MyParameter")); } else { Log.d(TAG, "fetch firebase remote config failed. Reason = " + task.getException()); } } });
The result was that I always got the default value: DefaultValue
What did I do wrong? What did I miss?