【发布时间】:2018-03-01 22:53:36
【问题描述】:
所以我现在已经设置了几次 A/B 测试实验,无论它是处于“草稿”阶段(我使用 InstanceID.instanceID().token() 定位我的测试设备)还是完全启动并运行实验(我设置了 100% 的用户匹配我的应用程序包 ID),当我这样做时,我没有看到我的测试变体中的参数到达远程配置:
func loadRemoteConfig()
{
let remoteConfig = RemoteConfig.remoteConfig()
let remoteConfigSettings = RemoteConfigSettings(developerModeEnabled: true)
remoteConfig.configSettings = remoteConfigSettings!
remoteConfig.setDefaults(fromPlist: "RemoteConfigDefaults")
remoteConfig.fetch(withExpirationDuration: TimeInterval(1)) { (status, error) in
if let actualError = error
{
DDLogError("error from loadRemoteConfig is \(actualError.localizedDescription)")
} else {
switch(status)
{
case RemoteConfigFetchStatus.noFetchYet, RemoteConfigFetchStatus.failure, RemoteConfigFetchStatus.throttled :
DDLogDebug("loadRemoteConfig got a \(status) status")
case RemoteConfigFetchStatus.success :
break
}
remoteConfig.activateFetched()
// my A/B test parameter doesn't arrive in this array, ever.
let arrayOfKeys = remoteConfig.allKeys(from: RemoteConfigSource.remote, namespace: NamespaceGoogleMobilePlatform)
print("array of keys is \(arrayOfKeys.count) & \(arrayOfKeys)")
// do some stuff here, depending on what Firebase tells us to do...
}
}
self.remoteConfig = remoteConfig
}
此代码位于初始视图控制器中,而不是应用委托中。
这是我的 Firebase A/B 页面的样子,我只想在其中显示一个演示工具提示:
如何让 A/B 测试和实验参数与 RemoteConfig 提取一起显示?
【问题讨论】:
标签: ios firebase ab-testing firebase-remote-config