0

I am using Firebase Remote config in a capacitor.js App using @capacitor-firebase/remote-config firebase plugin. I have the parameter set for first_open and the conditions are true if the first_open is after a set date and false if before the date. Default is set to false.

important part to the code is:

async function initializeSubscribe() {
  try {
     await Capacitor.Plugins.FirebaseRemoteConfig.fetchConfig({
       minimumFetchIntervalInSeconds: 0,
     });

    Capacitor.Plugins.FirebaseRemoteConfig.activate()
 .then(async () => {                     
    const data = await Capacitor.Plugins.FirebaseRemoteConfig.getBoolean({
            key: "first_user",
          });

          const user = data.value;
          console.log("first_user:", user);
          handleRemoteConfig(user, isDateValid);
      
      })
      .catch((err) => {
        console.error(err);
      });
  } catch (err) {
    console.error(err);
  }
}

I've tried adding settimeout as a possible solution but I can't get it to retrieve the value the first time.

This happens only in iOS, Android has no issue with it. Any help would be appreciated.

1 Answer 1

0

This issue was recently resolved and will be published with the next release. You can install the dev version:

npm i @capacitor-firebase/[email protected]

Sign up to request clarification or add additional context in comments.

1 Comment

I saw that on Github just after I posted this and installing the dev version worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.