Problems with Game Center: iTunes Connect? Profiling? Something other?

I'm having problems launching Game Center.

My application only works on iOS 6 and above, and I use the standard code for authentication with Game Center:

GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error) { // Respond to authentication (failure or success) here! } 

With this code, the application works beautifully and without problems for several weeks, for itself during development and with ~ 10-15 beta testers in special distributions.

For most of this time and for most users, the application behaves as you would expect: if you did not log in to Game Center when you started the application or did not log into your Game Center account, the application will offer you (with the modal Game Center-themed View Controller ) to log in with your Sandbox account. You log into your sandbox account and everything just works.

For a few users, however, something very strange started.

The authenticateHandler code is called, error is nil , but [GKLocalPlayer localPlayer].authenticated is NO , and the user is not logged into Game Center. Most importantly, there is no Game Center modal dialog box to prompt a user to log in. The application just starts, the authenticateHandler code is called, but authentication is not performed. I think the application will work if the Game Center application allows me to log in to my account in the sandbox, but this is not so: logged in or logged out of my Game Center account, there is no option to log in to the sandbox.

Since this only happens with some users and has just begun for my development device, I doubt very much that this is a problem with my code, and I assume that this is a complicated interaction between iTunes Connect, training profiles, the game Central settings and history on the device, etc. .d.

The game center is included in our app ID and in iTunes Connect (and app IDs for both matches).

Help!

Edit

My problem might be similar to iOS Development: a strange problem with Game Center user authentication . The solution proposed for this issue was to manually enter the Game Center application. This seems like a reasonable solution, but I need to enter the sandbox environment, and I cannot find a way to get an invitation to enter the Sandbox Game Center in the Game Center application.

+6
source share
1 answer

I just tried on my device what happens if a user disconnects Game Center: the user can no longer access the Game Center login controller from within the application. You need to send some instructions for user login manually.

I also went to the Game Center manually and logged into my account (my regular account with my regular iTunes account), and after returning to my application, I was automatically authenticated without any additional prompts. I would say that if you have a separate email / account for the sandbox GC account, you will again get the auth dialog box.

TL DR: put some instructive text on what the user should do if you cannot get a modal dialog. Look at the Apple code in the GameKit Programming Guide (PDF page 36, Listing 3-1). You need to execute this code in the else part.

+1
source

All Articles