有没有办法以编程方式从权利中读取AppGroup。
我已经实现了以编程方式读取AppGroup但无法以编程方式获取Entitlements文件名。您能否建议如何以编程方式从构建设置中读取CODE_SIGN_ENTITLEMENTS
的值。
NSString *path = [[NSBundle mainBundle] pathForResource:@"MY_APP_TARGET_NAME"
ofType:@"entitlements"];
NSDictionary *dict = [[NSDictionary alloc]initWithContentsOfFile:path];
NSArray *appGroups = [dict objectForKey:@"com.apple.security.application-groups"];
for(NSString *appGroupValue in appGroups) {
if([appGroupValue hasPrefix:@"group.com.xyz.myAppName"]) {
appGroup = appGroupValue;
}
}