Closed
Description
[REQUIRED] Describe your environment
- Operating System version: MacOS
- Browser version: Latest Chrome 77
- Firebase SDK version: Latest/7.0
- Firebase Product: Remote Config
[REQUIRED] Describe the problem
Steps to reproduce:
Remote Config getString() (and I presume others), don't return correct values based on conditions setup using user properties
Relevant Code:
Maybe I'm doing something wrong, but here is what it is right now...
- setup remote config WelcomeMessage in firebase and define condition for a value based User Property
state
(say default value isWelcome!
and for users withstate
=ca
set value asWelcome CA!
- run code below and check output for
remoteConfig.getString('WelcomeMessage')
- no matter what I tried, the value always comes back as default and not based on the condition setup around user property
firebase.initializeApp(firebaseConfig);
const remoteConfig = firebase.remoteConfig();
remoteConfig.settings = {
minimumFetchIntervalMillis: 3600000,
defaultConfig: {
'WelcomeMessage': 'Welcome Default'
}
};
firebase.analytics().setUserProperties({
state: 'ca'
},{
global: true
});
remoteConfig.fetchAndActivate()
.then(() => {
console.log("Remote-config initialized")
console.log(remoteConfig.getString('WelcomeMessage'))
})
.catch((err) => {
console.error("Remote config error", err);
});