ios-library icon indicating copy to clipboard operation
ios-library copied to clipboard

Ability to land

Open marapz opened this issue 8 months ago • 3 comments

Hi, I'm working on iOS project (Swift + SwiftUI) which requires some delayed Airship initialization and ability to change the Airship configuration on the fly. Is there any option to reset/stop Airship SDK, apply new configuration and start again? On Android, there is something like land() function which seems doing exactly what I need, but can't find it on iOS. My current initialization looks like this:

        var airshipConfig = AirshipCore.AirshipConfig()
        airshipConfig.defaultAppKey = ...
        airshipConfig.defaultAppSecret = ...
        airshipConfig.site = .eu
        airshipConfig.urlAllowListScopeOpenURL = ["*"]

        try Airship.takeOff(airshipConfig, launchOptions: [:])

        Airship.push.pushNotificationDelegate = self
        Airship.deepLinkDelegate = self
        Airship.messageCenter.displayDelegate = self

I need an ability to reset the SDK and launch initialization code again or just replace the configuration.

marapz avatar Apr 03 '25 12:04 marapz

This is not something we support nor plan on supporting soon. Could you provide the reasons why you need to switch the app credentials at runtime?

rlepinski avatar Apr 03 '25 14:04 rlepinski

Let's say app supports more than one markets/countries where content is different for each country. There are also different marketing campaigns and teams that manage those campaigns. Also, user accounts are not shared between countries. App allows user to switch between countries/configurations. It means, Airship configs are also maintained separately for each "source of data" - there is a separate Airship project for each configuration. Is it possible to get something similar to what Android has - land() method which resets the SDK and allow us to start it again?

marapz avatar Apr 03 '25 20:04 marapz

Android land is marked as internal and wont work as expected. Airship only supports a single app per init at at time. Others have accomplished such a thing by deciding up front for that app init and then using that until it changes. I would suggest using a tag or some other segmentation instead.

rlepinski avatar Apr 03 '25 21:04 rlepinski