Authenticating with Game Center

Once your app has determined whether the device is Game Center–capable, you can authenticate the user. The user who is authenticated with Game Center will always be referred to as the local player and will be represented by the class GKLocalPlayer. Before any other Game Center functionality can be used, you must first authenticate a local player.

Apple recommends that you authenticate with Game Center as early as possible in your app. The primary reason to authenticate before the user needs to access any Game Center behavior is to ensure that the user is not waiting for the network callbacks to authenticate a user at a time when he or she wants to perform a Game Center action. Early authentication also makes sure ...

Get Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.