iOS App Extensions
App Extensions in Apple operating systems are important features that let you extend custom functionality and content beyond your app and make it available to users while theyโre interacting with other apps or the system. Qonversion also supports this feature.
Understand How an App Extension Works
Configuring the App
First, you need to enable data sharing between your app and shared extensions.
- Enable app groups for the containing app and extension via Xcode or the Developer portal. Choose your App target in Xcode. Select
Signing & Capabilities
, click+ Capability
and selectApp Groups
. - Register the app group in the portal. In Xcode, add the new App Group ID.
- Choose that App Group ID for the extension and containing app.
- Pass user defaults instance created with a suite name to Qonversion via Qonversion.Configuration
setCustomUserDefaults()
function.
let config = Qonversion.Configuration(projectKey: "project_key", launchMode: .subscriptionManagement)
...
// any other configurations
...
config.setCustomUserDefaults(.init(suiteName: "app_groups_id_from_previous_step"))
Qonversion.initWithConfig(config)
QONConfiguration *configuration = [[QONConfiguration alloc] initWithProjectKey:@"project_key" launchMode:QONLaunchModeSubscriptionManagement];
...
// any other configurations
...
[configuration setCustomUserDefaults:[[NSUserDefaults alloc] initWithSuiteName:@"app_groups_id_from_previous_step"]];
[Qonversion initWithConfig:configuration];
After those steps, all content stored in the user defaults will be shared between the shared extension and containing App.
Updated 3 months ago