1
mFirebaseRemoteConfig.fetch(0)
                .addOnCompleteListener(new OnCompleteListener<Void>() {
                    @Override
                    public void onComplete(@NonNull Task<Void> task) {
                        if (task.isSuccessful()) {
                             System.out.println("Fetch Succeeded");
                            // Once the config is successfully fetched it must be 
                            // values are returned.
                            mFirebaseRemoteConfig.activateFetched();
                        } else {
                            System.out.println("Fetch failed");
                        }  
                    }
                });

I added this to get the remote config from the server. I was able to get the values a couple of times. I updated the remote config conditions after that and now fetch doesnt return anything. Tried a lot of approaches including moving the call after on onResume and calling it from a separate thread. Updating to 9.2.1 also didnt worked for me What else can be done to get the config?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Manish
  • 11
  • 2
  • Are you calling fetch() in onComplete? If so this is a known bug that happens very rarely, try calling it in onStart() or later. – Sam Stern Jul 25 '16 at 20:55
  • @hatboysam: It works on some devices and doesnt on most of the devices. – Manish Jul 25 '16 at 21:27
  • Yep that sounds about right. Try calling fetch later in your app's lifecycle. – Sam Stern Jul 25 '16 at 21:33
  • 1
    Found the issue..We need to have google play services 9.2 installed on the devices. I have few devices which has lower versions. I updated it and it worked fine. – Manish Jul 25 '16 at 22:36
  • ah yes that would definitely cause the same thing. You can use the GoogleApiAvailability class to check if you have the right version at runtime if you want to make sure your app works on all devices. – Sam Stern Jul 25 '16 at 23:31
  • Possible duplicate of [Firebase Remote Config: Can't read any values, but fetch is successful](http://stackoverflow.com/questions/37311582/firebase-remote-config-cant-read-any-values-but-fetch-is-successful) – shoheikawano Jul 26 '16 at 01:01

0 Answers0