【问题标题】:Remote Config A/B Test does not trigger on test devices (or for 100% matches)远程配置 A/B 测试不会在测试设备上触发(或 100% 匹配)
【发布时间】: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


    【解决方案1】:

    好的!这是我自己解决的问题之一。

    发生的事情的关键在于我的问题的这句话:

    此代码位于初始视图控制器中,而不是应用委托中。

    发生的情况是applicationDidFinishLaunching: 不一定完成(或者,更具体地说,remoteConfig.fetch 的结果或完成块在applicationDidFinishLaunching 结束之前没有被触发)。

    因此,在 remoteConfig 从 Firebase 检索更新之前,我正在检查初始视图控制器的 viewDidLoad 函数中的远程配置值。

    根据remoteConfig.fetch 的结果向新注册的观察者发送通知允许我显示我的 A/B 测试参数。

    【讨论】:

    • 为我工作..:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多