I am using extensions in my application. For sharing data between app and extension using app Groups. How Can I read App Group name programmatically so no need create extra configuration file for storing App Group name.
You'll only be able to use this in development (Debug mode), the entitlements
are written into the embedded.mobileprovision
file in the app bundle.
The embedded.mobileprovision
will not be included when you archive an .ipa
file or deliver your app to the AppStore
.
When in Debug
you can try this:
/* Swift 3 */
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
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With