views:

216

answers:

2

I'm developing an iPhone game with Game Center integration. The game is being built as Debug (not release/distribution). On the simulator, Game Center always uses the sandbox properly. On the iPhone device itself, it will go for a few days using the sandbox, then suddenly decide to use the real Game Center servers (which results in an error, because my game has not yet been released). It's been avoiding the sandbox for several days now, and I hate testing on the simulator. Any idea how to once and for all make it use the sandbox during development?

Here's the relevant quote from the Game Kit Programming Guide:

As a developer, your Game Center account may be logged into either Sandbox for testing, or into the live environment but not both. To change which account you are logged into, switch to the built-in Game Center app and log out, then run any Game Center enabled app. If that app is provisioned for development, enter your test account information to log into Sandbox. Otherwise, enter your live account information to log into the live environment.

As far as I can tell, my app is being provisioned using a Developer Provisioning Profile. The build mode is set to Debug. I have signed out of Game Center on the device. I also tried signing out of the Store for good measure.

A: 

The Game Center Programming Guide has a section describing when the sandbox environment is and isn't used (scroll down to "Testing a Game Center Application").

The table there gives the impression that developer builds always use Sandbox, but that's not quite been my experience. It has been my experience, however, that if I'm signed out of Game Center (using the Game Center app), when I run my app (device or not) that it prompts me to sign in to Sandbox. Which I guess is what the doc says, now that I'm re-reading it.

zpasternack
I'm definitely signed out of Game Center using the Game Center app. I've read the documentation repeatedly, looking for clues, and haven't been able to solve it.
Allara
A: 

I restored my iPhone from a backup. This had the effect of removing all provisioning profiles and the game itself. I then used Xcode to install and run the game, and sandbox magically started working again. I'm not sure if the full restore was required, or just removing the game. I had previously tried removing all provisioning profiles, and that didn't work. I suspect the restore was likely necessary in my case.

Allara