Support app extensions
It's important to track iOS app extension usage to guarantee fair revenue calculations. Here's the list of app extension types that we support:
iOS App Extension Type | Status |
---|---|
Action | π In planning |
App Intents | β Supported |
Custom Keyboard | β Supported |
Network | π In planning |
Notification Service | π In planning |
Photo Editing | π In planning |
Share | π In planning |
Widget | β Supported |
If you have an app extension not listed above, please inform your Developer Support Representative so we can discuss it further.
The Setapp Framework provides built-in functionality for reporting app extension usage. To apply, proceed with the steps below.
Note
This functionality is avaliable within Setapp Framework version 4.3.0-beta.4 or later.
1. Prepare the host app
To report usage events correctly, a few additional steps are required for your host app setup:
- Add Keychain Sharing capacity.
This feature is required to share the session token between your host app and the extension. Usage reporting requests sent from the extension will fail without it. You can select any identifier, but we suggest your app's bundle identifier.
This capacity does not require modifying the provisioning profile. - Add App Groups capacity.
If there is no internet, usage events will be sent later with this capacity. If you don't have one, create a new container. This capacity requires an entitlement and modifying the provisioning profile (if you manage it manually). For more information, see Configuring App Groups.
-
Set the App Groups container name to a
SetappConfiguration
object.
Use theSetappConfiguration.appGroupIdentifier
property. Ensure the container name matches the app extension container name. Also, make sure to pass this configuration toSetappManager.shared.start(_:)
method.
Example:let configuration = SetappConfiguration( publicKeyBundle: .main, publicKeyFilename: "setappPublicKey-iOS.pem" ) configuration.appGroupIdentifier = "group.setapp"
2. Prepare the app extension(s)
After preparing the host app, you'll also need to prepare the app extension(s).
-
Add the public key(s) as a resource. It must be the same as for your host app.
-
Add Setapp Framework as a dependency.
-
Add Keychain Sharing capacity.
Ensure that the app extension and host app have the same identifier in the Keychain Sharing settings.
-
Add App Groups capacity.
Ensure the app extension and the host app have the same container in the App Groups.
-
Set the App Groups container name to a
SetappConfiguration
object.
Use theSetappConfiguration.appGroupIdentifier
property.
Make sure the container name matches the one that you've enabled for the app extension.
Example:let configuration = SetappConfiguration( publicKeyBundle: .main, publicKeyFilename: "setappPublicKey-iOS.pem" ) configuration.appGroupIdentifier = "group.setapp"
-
Start Setapp Manager
UseSetappManaher.shared.start(_:)
or.start(_:_:)
method. Use theSetappConfiguration
object from the previous step. -
(Optional) Report additional events based on your app extension functionality.
When the Setapp manager starts in an app extension, it automatically reports the launch usage event. Usually, it's enough to track whether the user interacted with the app extension. However, you might want to report additional usage interaction events (for example, when the keyboard appears on the screen in a keyboard extension). For this, useSetappManager.shared.reportExtensionUsage()
method.
Updated 7 days ago