OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Firebase - RemoteConfig with custom user properties return wrong value

  • Thread starter Thread starter Zoro
  • Start date Start date
Z

Zoro

Guest
I am setting userProperties for custom defined property (scope user) and userId in analytics using setUserProperties and setUserId, and fetching remote config based on the setted properties. but i am getting default config at first, but when any user comes again then it returned config are as per previous setted properties irrespective of the user.

This is the code snippet.

Code:
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
const remoteConfig = getRemoteConfig(app);

export const firebaseInit = async (userId, testProperty) => {
  // setting userId and userProperties
  setUserId(analytics, userId);
  setUserProperties(analytics, { testProperty: testProperty });

  // Fetching and activationg config
  remoteConfig.settings.minimumFetchIntervalMillis = 1000;
  const isActivated = await activate(remoteConfig);
  await fetchConfig(remoteConfig);
  const allConfig = getAll(remoteConfig);
};

I was expecting get correct config based and setted properties and i was setting userId to identify the user when it comes next time and get correct config.

<p>I am setting userProperties for custom defined property (scope user) and userId in analytics using setUserProperties and setUserId, and fetching remote config based on the setted properties.
but i am getting default config at first, but when any user comes again then it returned config are as per previous setted properties irrespective of the user.</p>
<p>This is the code snippet.</p>
<pre><code>const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
const remoteConfig = getRemoteConfig(app);

export const firebaseInit = async (userId, testProperty) => {
// setting userId and userProperties
setUserId(analytics, userId);
setUserProperties(analytics, { testProperty: testProperty });

// Fetching and activationg config
remoteConfig.settings.minimumFetchIntervalMillis = 1000;
const isActivated = await activate(remoteConfig);
await fetchConfig(remoteConfig);
const allConfig = getAll(remoteConfig);
};
</code></pre>
<p>I was expecting get correct config based and setted properties and i was setting userId to identify the user when it comes next time and get correct config.</p>
 
Top