远程配置A/B测试无法在iOS上提供结果 [英] Remote Config A/B Test does not provide results on iOS
问题描述
2天前,我在iOS应用上使用以下代码在Firebase Remote Config上创建并启动了A/B测试:
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.
问题在于,两天后,Firebase控制台一直说0个用户参加了该实验.另一方面,我使用相同的代码在Android上进行了另一项测试,几个小时后我就可以看到活动.
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.
有什么我想念的吗?
编辑-Pod版本:
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)
推荐答案
最后,我重现了该问题并找到了解决方法.
Finally I reproduced the issue and found a workaround.
关键是要从application:didFinishLaunchingWithOptions:
方法中分离activateFetched
.
The key is detaching activateFetched
from the application:didFinishLaunchingWithOptions:
method.
因此,这是解决方法(已在Firebase 4.7.0中进行了测试):
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];
});
这篇关于远程配置A/B测试无法在iOS上提供结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!