Search code examples
iosfirebaseab-testingfirebase-remote-config

Remote Config A/B Test does not provide results on iOS


I have created and started an A/B Test on Firebase Remote Config 2 days ago on my iOS app with this code:

[FIRApp configure];
[FIRRemoteConfig.remoteConfig fetchWithCompletionHandler:^(FIRRemoteConfigFetchStatus status, NSError * _Nullable error) {
        // Do nothing
    }];
[FIRRemoteConfig.remoteConfig activateFetched];

I have confirmed that the test is live because on some devices I can see the test going on.

The problem is that, after two days, the Firebase Console keeps saying that 0 users have participated on the experiment. On the other hand, I've done a another test on Android with the same code and I can see activity after few hours.

Is there something I'm missing?

Edit - Pods versions:

Using Firebase (4.5.0)
Using FirebaseABTesting (1.0.0)
Using FirebaseAnalytics (4.0.4)
Using FirebaseCore (4.0.10)
Using FirebaseInstanceID (2.0.5)
Using FirebasePerformance (1.0.6)
Using FirebaseRemoteConfig (2.1.0)

Solution

  • Finally I reproduced the issue and found a workaround.

    The key is detaching activateFetched from the application:didFinishLaunchingWithOptions: method.

    So, this is the workaround (tested with Firebase 4.7.0):

    [FIRApp configure];
    [FIRRemoteConfig.remoteConfig fetchWithExpirationDuration:60*60 completionHandler:^(FIRRemoteConfigFetchStatus status, NSError * _Nullable error) {
        // Do nothing
    }];
    
    dispatch_async(dispatch_get_main_queue(), ^{
        [FIRRemoteConfig.remoteConfig activateFetched];
    });