OSX - GameKit - com.apple.gamed.osx was invalidated

Originator:danoli3
Number:rdar://23594124 Date Originated:19-Nov-2015
Status:Open Resolved:
Product:OS X SDK Product Version:10.11
Classification:Serious Bug Reproducible:Always
 
Summary:
When developing a OS X Game Center with a AppSandbox the following error occurs when connecting to Game Center.

Could not get services from gamed. 
Please file a radar including GameKit logs, and any gamed crash logs. 
ERROR Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.gamed.osx was invalidated." 
UserInfo={NSDebugDescription=The connection to service named com.apple.gamed.osx was invalidated.}

Just to clarify:
- OSX Game
- Game Center Enabled
- Game Center Setup in iTunes connect and the Provisioning Profile.
- Entitlement App Sandbox = YES
- Entitlement set to com.apple.security.network.client = YES (and in iTunes Connect)

Steps to Reproduce:
1. Setup OSX Project with Game Center on.
2. Setup Game Center as documented on Apple Resources. (iTunes Connect / Apple Developer Identifier etc).
3. Test and Validate Game Center is working. Leaderboards etc.
4. Turn on AppSandbox (for Mac AppStore Submission).
5. Test Game in Sandbox.

Expected Results:
Game Center connection work exactly the same as before sandbox and function normally.

Actual Results:
Game Center never connects with the following error in the logs:
Could not get services from gamed. 
Please file a radar including GameKit logs, and any gamed crash logs. 
ERROR Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.gamed.osx was invalidated." 
UserInfo={NSDebugDescription=The connection to service named com.apple.gamed.osx was invalidated.}

Version:
Version 7.1.1 (7B1005) / OSX 10.11.2 Beta (15C40a) (It doesn't matter the build of OS X, I have seen the same report error from Yosemite to El Capitan 1).

Comments

Working Solution / Work around

Okay I submitted this with my working solution which is not documented anywhere, or setup automatically as I believe it should be. The following key is required to be added to the entitlements in AppSandbox mode to fix the bug posted. com.apple.developer.game-center (BOOLEAN) = YES

With this the Game / Game Center connection works perfectly.

My report is now, please update documentation (this is not referenced anywhere), and make it so when toggling AppSandbox in Xcode with Game Center on, it generates this key automatically.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!