I have an iOS app with a main target and an app extension. I want the app extension to write data to the SwiftData in App Groups, while the main target reads the data. However, currently, the app extension only has permission to read data, not to write it.Is the issue due to my incorrect configuration or an Apple-imposed restriction?
As @mungbeans mentioned, not all extensions can write to an App Group container. A keyboard extension with no full access is an example of that kind.
The other possibility is you intentionally create your model container with readonly mode by using init(_:schema:isStoredInMemoryOnly:allowsSave:groupContainer:cloudKitDatabase:) with allowsSave
being set to false
. It doesn't look like the case though, based on your description.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.