You can only use this in development (debug mode), entitlements written to the embedded.mobileprovision file in the application bundle.
embedded.mobileprovision will not turn on when you archive the .ipa file or deliver your application to the AppStore .
In Debug you can try the following:
if let path = Bundle.main.path(forResource: "YourProjectName", ofType: "entitlements") { let dict = NSDictionary(contentsOfFile: path) let appGroups: NSArray = dict?.object(forKey: "com.apple.security.application-groups") as! NSArray }
Oleh zayats
source share