So I've set up an A/B Test Experiment a couple times now, and regardless of whether it's in the "draft" phase (where I target my test devices using InstanceID.instanceID().token()
) or in a fully started and running experiment (where I set for 100% of users matching my app bundle ID), I'm not seeing the parameter in my test variant arriving in Remote Config when I do:
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
}
This code lives in the initial view controller and not the app delegate.
Here's what my Firebase A/B page looks like, where I simply want to show a tooltip for a demo:
How can I get that A/B test & experiment parameter to appear with a RemoteConfig fetch?