远程配置A/B测试不在iOS上提供结果

wil*_*lly 7 ab-testing ios firebase firebase-remote-config

我在2天前在我的iOS应用程序上使用以下代码在Firebase Remote Config上创建并启动了A/B测试:

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

我已经确认测试是实时的,因为在某些设备上我可以看到测试正在进行.

问题是,两天后,Firebase控制台一直说0个用户参与了实验.另一方面,我在Android上用相同的代码完成了另一项测试,几小时后我就能看到活动.

有什么我想念的吗?

编辑 - Pods版本:

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)
Run Code Online (Sandbox Code Playgroud)

wil*_*lly 1

最后我重现了这个问题并找到了解决方法。

关键在于脱离activateFetched方法application:didFinishLaunchingWithOptions:

因此,这是解决方法(使用 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];
});
Run Code Online (Sandbox Code Playgroud)