Expand my Community achievements bar.

Is it possible to switch the Adobe app ID used to send analytics on tvOS/iOS while the app is running?

Avatar

Level 1

For analytics we have three different Adobe app IDs: one for development, one for staging, and one for production. In the test version of our tvOS app we have added a way to switch between which app ID is being used. Whenever a tester switches the ID this code is called:

var extensions = [Media.self, Identity.self, Lifecycle.self, Analytics.self, Signal.self]

MobileCore.registerExtensions(extensions, {
    MobileCore.configureWith(appId: adobeApplicationID)
})

However after switching to a new app ID the analytics are still being sent to the previous environment, until the app is killed and restarted. 

Is there a way to make the switch so it is effective immediately, without having to restart the app?

1 Reply

Avatar

Level 1

You could use programmatic config instead of new config AppId to update it immediately
https://developer.adobe.com/client-sdks/documentation/mobile-core/configuration/#programmatic-update...

Refer the configuration keys for Analytics to update the fields needed for your test: https://developer.adobe.com/client-sdks/documentation/adobe-analytics/#configuration-keys

Thing to note:
It will not update the configuration on tags which the AppId refers to. It will just update the config locally and be persisted on the device.