iosswiftfirebasefirebase-remote-configfirebase-ab-testing

Don't get Firebase A/B draft experiment remote config value on my test devices


I'd like to create a Firebase A/B test experiment and tweak the setup before starting it by using the option to add a test device via its Firebase Instance ID, however, I never seem to get the Remote Config param for the experiment.

The fetch is triggered in applicationDidFinishLaunching of the AppDelegate:

        let remoteConfig = RemoteConfig.remoteConfig()
    #if DEBUG
        let expirationDuration: TimeInterval = 0
        remoteConfig.configSettings = RemoteConfigSettings(developerModeEnabled: true)
    #else
        let expirationDuration: TimeInterval = 3600
    #endif

    remoteConfig.fetch(withExpirationDuration: expirationDuration) { status, error in
        if let error = error {
            RLogError("FirebaseHelper >>> Error fetching config: \(error)")
        }

        RLogInfo("FirebaseHelper >>> Config fetch completed with status: \(status)")
        self.activateRemoteConfig()
    }

After activating the remote config in the callback the param is never there. If I start the experiment, however, the value appears. No matter if the app is re-launched multiple times or I uninstall and re-install the app and re-add the Instance ID to the Draft Experiment.

enter image description here

Any help is appreciated.


Solution

  • Turned out that my issues were related to the Firebase configuration which was failing on iOS Release builds. Rolling back to a fixed 5.15.0 version (current is 5.16.0 at the time of writing) resolved all issues I've had for now.