# 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.

{% hint style="info" %}
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](/developer/sdk/ios/sdk-integration/rich-notifications-setup.md).
{% endhint %}

### 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](/files/7aZXeq6jXw4gPGwAgvK1)

* 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](/files/Iw5FTC3RkYgmErOAiexX)

* 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](/files/Zp9uTwGNzBStCHTwRl6Q)

### 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](/files/iEkrISLYuOzB0vkJz9nm)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.batch.com/developer/sdk/ios/advanced/app-groups.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
