question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(remote-config): activate and fetchAndActivate returning false but successful

See original GitHub issue

Plugin(s):@capacitor-firebase/analytics”: “^1.2.0” “@capacitor-firebase/crashlytics”: “^1.2.0” “@capacitor-firebase/performance”: “^1.2.0” “@capacitor-firebase/remote-config”: “^1.2.0-dev.8dd4ad6.1668633721”

Platform(s): Android

Current behavior: Calling activate or fetchAndActivate returns the success callback but the result.booleanValue() is false and since it hasn’t been activated requesting any values fails to complete.

Expected behavior: Calling activate or fetchAndActivate then requesting a value succeeds.

Steps to reproduce:

  1. Make a call to fetchAndActivate
  2. Make a call to fetch some kind of value

Related code:

await FirebaseRemoteConfig.fetchAndActivate()

alert((await FirebaseRemoteConfig.getNumber({ key: 'my_number' })).value)

Other information: I testing on iOS and it works as expected. I double checked my google-services.json seems to be loaded correctly account to logcat. I also sent a test event using the analytics plugin which was success. Here are some screenshots of what I’m seeing when debugging:

Screenshot 2022-11-27 at 6 23 34 PM

Screenshot 2022-11-27 at 7 50 11 PM

Capacitor doctor:

Latest Dependencies:

  @capacitor/cli: 4.5.0
  @capacitor/core: 4.5.0
  @capacitor/android: 4.5.0
  @capacitor/ios: 4.5.0

Installed Dependencies:

  @capacitor/cli: 4.5.0
  @capacitor/core: 4.5.0
  @capacitor/android: 4.5.0
  @capacitor/ios: 4.5.0

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
robingenzcommented, Nov 28, 2022

Regarding the success value:

Task with a true result if the current call activated the fetched configs; if no configs were fetched from the backend and the local fetched configs have already been activated, returns a Task with a false result.

Source

So you already had the up-to-date configs.

0reactions
mcfarljwcommented, Dec 7, 2022

I haven’t been able to consistently reproduce this so am closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remote Config fetch always returns false · Issue #3705 - GitHub
I can verify that this is always returning false, but activation is actually successful because I can see new parameters in the app....
Read more >
Firebase Remote Config: Can't read any values, but fetch is ...
The success one gets called and then I use the activateFetched. But I still can't get the right value, it's coming as false...
Read more >
Firebase Remote Config loading strategies - Google
An effective strategy is to load new configuration values to activate on your app's next startup. In this strategy, your app activates fetched...
Read more >
Firebase Remote Config: 3 lessons learned - Dipien
The fetchAndActivate() or fetch() functions on FirebaseRemoteConfig can fail if the user is not having an internet connection when invoking them.
Read more >
Firebase Remote Config Quickstart
fetchAndActivate returns true if the final set of key/value pairs now available to the application is different to the set before calling fetchAndActivate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found