I am attempting to share Core Data between a Network Extension and the containing application on MacOs. The Network Extension and containing application both have the same AppGroup entitlement and I use the following to get the URL for the storage:
let url = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "my-group-name")
For the containing application, the resulting URL is of the form:
/Users/***/Library/Group Containers/my-group-name
But for the Network Extension, the resulting URL is different:
/private/var/root/Library/Group Containers/my-group-name
Both the Network Extension and containing application can access their respective Core Data stores, but, of course, they are not shared since the URLs are different.
What am I missing? How is Core Data supposed to be shared between a Network Extension and the containing application?
And, if it matters, I am creating a DNSProxy type extension.