Data Sharing Between App and App Extensions

Prafulla Singh
Mac O’Clock
Published in
3 min readApr 28, 2020

--

Before we start, we need to understand how App extensions work. An App extension is an App, created by extending from extension and resides into Containing App. A Containing App is our main app, which we ship along with extensions. To run these extensions, Apple has preinstalled Apps. These Apps called the Host App(ex. Messager App for Sticker Pack extension).

Image from developer.apple.com

A Containing apps(the app we are creating) sandbox look like the following:

Image from developer.apple.com

An App cannot access data outside the sandbox due to privacy and security reasons. To support App extensions Apple provides shared resources called App group.

Image from developer.apple.com

App Group only works when we enable it in Containing App, App extension as well as App Developer Portal.

How to create App groups?

Select App or App Extension => signing & capabilities => Click +

--

--