Container Issues for Mac OS Sandbox Group

I am having problems with two Sandboxed applications in the same application group. In my Entitlements file, I have the following:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/ PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.application-groups</key> <array> <string>TEAM_ID.com.Company.AppName</string> </array> </dict> </plist> 

Where "Company" and "AppName" are replaced by my company, as well as the name of the application and TEAM_ID with the identifier of my team. Both applications have the same rights.

Now, when I create and run both applications, everything seems to be going quite well. Except for the fact that in the ~ / Library folder in the ~ / Library folder there is no "Group Containers" folder ... There is a "Containers" folder with a folder for both applications. But the folder with group containers is missing.

I am running 10.8.2 and the goal of deploying my application is 10.8.

According to the library of developers, it should be available from 10.7.4. I used this: https://developer.apple.com/library/mac/#documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW19 to create my rights .

What am I doing wrong?

Thanks,

+4
source share
1 answer

Someone at the official Apple developers forum suggested creating a folder programmatically, which was the solution to my problem!

 NSString *groupContainer = [@"~/../../../Group Containers/TEAM_ID.com.Company.AppName" stringByExpandingTildeInPath]; [[NSFileManager defaultManager] createDirectoryAtPath:groupContainer withIntermediateDirectories:YES attributes:nil error:NULL]] 

I used the Group Container folder for the plist file, in which my main application can write the parameters that my helper application (deamon) can use (using the initWithContentsOfFile: and writeToFile: NSMutableDictionary methods). This works great now :)

+2
source

All Articles