App Groups

Starting with Batch SDK 1.16.0, groundwork has been layed to enable some future features that require that the extension and application are able to communicate.

We'll go through the process of setting App Groups up for your application.

Note: This tutorial assumes that you have already added a Notification Content extension. If you don't, jump straight to Integrating the Batch Extension SDK.

Enabling App Groups capability

  • Open your Xcode project and go your main Target settings.
  • Open the Signing & Capabilities tab and click the + Capability button, in the new window, select App Groups.

Xcode Capabilities

  • Under the App groups section, click the + button
  • Set the new container to be group.YOUR-BUNDLE-IDENTIFIER.batch where YOUR-BUNDLE-IDENTIFIER is the bundle identifier of your main target

Xcode App Group

  • Reproduce those steps with the target of your Notification Service Extension. Make sure the container's name of your extension is the same as set in your main target.

Xcode App Group Extension

Use a pre-existing App Group

If you've already set up an App Group and don't want to make another one, you can ask Batch to use another App Group than the predefined one:

  • Open your Info.plist of your main target AND extension
  • Add your container name using the BATCH_APP_GROUP_ID key

Xcode Info.plist