I recently added a provisioning profile to the Apple portal. I downloaded the certificate, installed it on the device. I changed the Bundle ID in XCode to match the app id. i.e. com.company.gamename
The app runs fine on the device. In the portal it shows the app as Game Center enabled.
OK, heres the problem:
When I try to authenticate a user on the device (or the simulator for that matter) in debug build (sandbox) it generate a dialog box displaying 'Game not recognized by Game Center'.
I can't think of anything else I need to set up.
I read the iTunes Connect Developer Guide but it focuses on adding a new application and configuring Game Center there, but this is for a game ready for Apple approval.
How can I set up Game Center in development without adding a game (can I). Where am I going wrong, is there anything simple I have missed?
Start your app. When you authenticate the local player you should get a dialog to appear that says '*** SANDBOX ***'. Create/Log in with your sandbox account and everything will work.
The problem you are seeing is that you've logged in with a non-sandbox account into gamecenter, so it's contacting the live production servers and obviously, your game isn't there.
AFAIK, you can only log into the sandbox via an app and not the GC app itself.
I submit a help request to Apple and they were really helpful!
The documents and iTunes connect can be a little confusing for somebody who has never used Game Center.
In the provisioning section when your App ID has Game Center enabled against it, it actually means it is available to your game. NOT enabled.
Your game only uses the bundle id to distinguish the game on Game Center servers, it doesn't use provisioning profiles. Make sure the bundle id is identicle.
You MUST (and this is the bit I didn't do) add a game in iTunes connect as if you are submitting a game for Apple review. Simply add a temp icon and screenshot (this is a bit odd in my opinion because you don't usually put your screenshots together until the back end of a project). When your game is added you can enable Game Center on the app. There is obviously no need to submit the game for review, just simply add the game.
Simple, but a little confusing at first - for me anyway!
I also get an error when trying to create a new account in sandbox mode. I have done all the above, but it still doesn't work.
I'm working with an update of an existing app, do I just have to enable it in iTunes Connect, or do I have to create a new version that enables it, without uploading a binary.
I also have problems with the sample project of Apple, GKTapper. I thought that it might work with that, but it also doesn't work.
Start your app. When you authenticate the local player you should get a dialog to appear that says '*** SANDBOX ***'. Create/Log in with your sandbox account and everything will work.
The problem you are seeing is that you've logged in with a non-sandbox account into gamecenter, so it's contacting the live production servers and obviously, your game isn't there.
AFAIK, you can only log into the sandbox via an app and not the GC app itself.
Yes, please explain how to create a sandbox account. I cannot find anything about how to do this. My game is being run in debug, and works in the simulator but i cannot test on my device without creating a sandboxed game center account.
There are some notes at the start about setting up itunes connect properly.
The basic code example xcode project from the first tutorial will not let me authenticate with GC on my device, but the completed xcode project from the second tutorial will. It must be something to do with the itunes connect side. I didn't register anything special myself, just the standard stuff to be able to run stuff on a real device. Possibly the author of the tutorial has set up the itunes connect things properly on the second tutorial, but not the first.
So if you can figure out what the difference is between the two versions of the project, you'll have your answer. There is no special 'sandbox' account required, I don't think.
Yep - I found the difference. The basic app from tutorlal ! had a different bundle identifier from the complete app in the second tutorial. Changed it, deleted app from device, cleaned and re-built. Works. So it is all about getting the itunes app id and bundle identifier correct I think.