0

In the iOS code below, the status of the fetch is FIRRemoteConfigFetchStatusSuccess. When activateFetched is applied in the handler, the result is true. It looks to me therefore as if it should be the case that you can access the remote config values from the server. However, it is only the local value that is obtained when do [FIRRemoteConfig remoteConfig][@"greeting"].stringValue;

On Firebase console have set a parameter called "greeting". What possible reasons are there to explain why it is not retrieving the server value for this parameter?

- (void)fetchFirebaseRemoteConfig {

long expirationDuration = 43200;
if ([FIRRemoteConfig remoteConfig].configSettings.isDeveloperModeEnabled) {
    expirationDuration = 0;
}

[[FIRRemoteConfig remoteConfig] fetchWithExpirationDuration:expirationDuration completionHandler:^(FIRRemoteConfigFetchStatus status, NSError *error) {
    if (status == FIRRemoteConfigFetchStatusSuccess && error == nil) {
          BOOL didApply = [[FIRRemoteConfig remoteConfig] activateFetched];
       ALog("Did apply remote config OK: %d", didApply);
    } else {
        ALog(@"Error %@", error.localizedDescription);
    }
    NSString *greeting = [FIRRemoteConfig remoteConfig][@"greeting"].stringValue;
        ALog(@"greeting: %@", greeting);


    }];
}
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Jmf
  • 407
  • 3
  • 9
  • Did you take into account the fact that RC values are cached for up to 30m? – Kato May 24 '18 at 14:57
  • Thanks for your suggestion. Unfortunately, it's still only showing the local value the next day. it's an interesting point you made though, I had assumed that if I had developer mode on and set expiration to 0, that any changes would be immediate. Does that mean if I make a change in attempting to fix the issue, that I should wait 30 minutes each time to see if it has? – Jmf May 25 '18 at 08:37
  • I've now been able to get the Firebase remote config example to work against my Firebase project. I can update the Firebase console and immediately see the changes in the example project. I then put the same code in my own project. I can see in my project what the latest value was retrieved by the example project. However, if I update the Firebase console, I don't get that latest value. If though I go into the example project, that latest value is retrieved. And if I then start up my project, it gets that latest value. It looks like only the example project is able to update the cache. – Jmf May 25 '18 at 15:01
  • Gave up on this in the end. Did report issue to Firebase support, but could not get to the bottom of it. Switched to another product. – Jmf Oct 19 '18 at 08:25

0 Answers0