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 TypeStatus
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:

  1. 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.
  2. 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.

  1. Set the App Groups container name to a SetappConfiguration object.
    Use the SetappConfiguration.appGroupIdentifier property. Ensure the container name matches the app extension container name. Also, make sure to pass this configuration to SetappManager.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).

  1. Add the public key(s) as a resource. It must be the same as for your host app.


  2. Add Setapp Framework as a dependency.


  3. Add Keychain Sharing capacity.
    Ensure that the app extension and host app have the same identifier in the Keychain Sharing settings.


  4. Add App Groups capacity.
    Ensure the app extension and the host app have the same container in the App Groups.


  5. Set the App Groups container name to a SetappConfiguration object.
    Use the SetappConfiguration.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"
    
  6. Start Setapp Manager
    Use SetappManaher.shared.start(_:) or .start(_:_:) method. Use the SetappConfiguration object from the previous step.

  7. (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, use SetappManager.shared.reportExtensionUsage() method.