Game Development Reference
In-Depth Information
method that's passed as a parameter to the authenticateWithComple-
tionHandler method. It's run only after the authentication request has returned
from the server.
If you call the authenticateLocalPlayer method, your game will display the
Game Center sign-in dialog, shown in Figure 14-4 . If you have an Apple ID, you can
sign in with your Apple ID and password. Or you can choose to create a new account.
Figure 14-4 . Game Center sign-in dialog
But there's a third possibility—if Game Center detects that there's already a signed-in
player on this device, it simply greets you with a “Welcome back” message. How do
you sign out in that case? Through the Game Center app, which also exists on the
iPhone/iPad Simulator for that very reason.
If you run the Game Center app, select the first tab that reads either Me or Sandbox and
then click the label at the bottom that starts with Account:. You'll get a pop-up dialog
that allows you to view your account or sign out. After signing out through the Game
Center app, the next time you run your app, and it's going through the player authentic-
ation process, the sign-in dialog in Figure 14-4 will be shown again.
Note If the [GKLocalPlayer localPlayer].underage property is
set after the local player was authenticated, some Game Center features are dis-
abled. You can also refer to the underage property if your game should dis-
able optional features that aren't suitable for underage players.
Search Nedrilad ::

Custom Search