6

I'm struggling to get past the first stage of getting Game Center integration to work. I've got this far:

I've created a new, clean app, added the GameKit headers and the basic authenticateWithCompletionHandler: method in the app delegate.

Starting the app in the simulator brings up the login dialogue.

If I create a NEW account via the login dialogue, then that user gets authenticated and the app loads successfully.

If I attempt to log in with that account a second time, OR use an account that I've created using the simulator's Game Center app, the login is rejected with a "this game is not recognized by Game Center" error.

Resetting the simulator and reinstalling via XCode has no effect. The app is set up for Game Center via iTunes Connect, and the bundle identifiers are all correct.

Can anyone suggest where I'm going wrong here?

TimD
  • 8,014
  • 2
  • 24
  • 34

4 Answers4

1

Check Your app is Game Center enabled in iTunes. Also check the correct bundle Identifier you are given in you project

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Vineesh TP
  • 7,755
  • 12
  • 66
  • 130
0

So having played around with this for a while, I ended up creating a completely fresh app on iTunes Connect and in XCode, and a new set of user accounts as well. That's not suffering from the same problems, from which I assume that there was some issue with the bundle identifier and/or things getting confused with inadvertent use of 'live' accounts.

Thanks for the help, though!

TimD
  • 8,014
  • 2
  • 24
  • 34
0

This post explains it pretty well (skip past the Cocos2D-specific part at the top): http://www.cocos2d-iphone.org/forum/topic/20998 You can see all the steps needed there. And if it still doesn't work, then the bottom line is: wait 24 hours after creating the app (weekends don't count).

Dimitris
  • 13,480
  • 17
  • 74
  • 94
-1

You have to create a test account through itunesconnect. The test accounts are flagged and work with the GameCenter sandbox server.

IronMensan
  • 6,761
  • 1
  • 26
  • 35
  • Thanks - I've added in a new test user via iTunes Connect, and set that up for Game Center via the simulator's Game Center app. But I'm still getting the same error from the app, regardless of whether the test user is logged into Game Center or not. Is there additional code I'm missing, perhaps? – TimD Jul 07 '11 at 20:32
  • @TimD when Apple first added GameCenter, there were lots of warnings about how to use a test account, some of which were about how a test account could be turned into a regular account. Some of the warnings don't apply anymore; I've broken some of them and seen no ill effects. But to fully follow the guidelines, you should only sign in with your test account in-app (not through the game center app) and only when the debugger is running. Try deleting your app from the simulator, re-install and then login in-app. – IronMensan Jul 07 '11 at 20:41
  • 1
    @TimD There could be other things wrong as well. Double check your bundle identifier in your Info.plist against what you have in itunesconnect. And I guess I should mention the obvious, have you enabled GameCenter for your app in itunesconnect? – IronMensan Jul 07 '11 at 20:52