Platforms to show: All Mac Windows Linux Cross-Platform

Back to GKLocalPlayerMBS class.

GKLocalPlayerMBS.authenticate(tag as Variant = nil)   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
This item is deprecated and should no longer be used. You can use SetAuthenticateHandler instead.
Prompts the player to confirm their identity.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls GameKitMBS.authenticateCompleted event.

Your game should authenticate the player as early as possible after launching, ideally as soon as you can present a user interface to the player. For example, your game may be launched because the player accepted an invitation to join a match or to take a turn in a turn-based match, so you want your game to authenticate the player and process the match invitation as quickly as possible.

If there is not an authenticated player on the device when your game calls this method, Game Kit displays a user interface that allows the player to sign in with their credentials (or to create a new account if he or she has never used Game Center). Your game should pause other activities that require user interaction (such as a real time game loop) before attempting to authenticate the local player.

Each time the completion handler is called, the data stored in the the GKLocalPlayer singleton object may have changed. A new player may have logged into the device or the player may have simply logged out from Game Center. Because of both of these possibilities, your completion handler must be prepared update any state of the game that assumes that a particular player is logged in if it discovers that the local player has changed. For more information, see "Authenticating the Local Player in a Multitasking Application" in Game Kit Programming Guide.

Deprecated in Mac OS X 10.9.

GKLocalPlayerMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates new object pointing to the shared instance of the local player.

GKLocalPlayerMBS.friends as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A list of player identifiers for the local player's friends. (read-only)

This property is invalid until a call to loadFriends succeeds.

GKLocalPlayerMBS.loadDefaultLeaderboardCategoryID(tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 13.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Loads the category identifier for the local player's default leaderboard.

Calls later GameKitMBS.loadDefaultLeaderboardCategoryIDCompleted event.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls GameKitMBS.loadDefaultLeaderboardCategoryIDCompleted event.

Available on Mac OS X 10.8.2 and newer.

GKLocalPlayerMBS.loadFriendPlayers(tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 15.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Retrieves a list of player identifiers for the local player’s friends.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

Available in OS X v10.10 and later.
Calls later loadFriendPlayersCompleted event in GameKitMBS class.

GKLocalPlayerMBS.loadFriends(tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Retrieves a list of player identifiers for the local player's friends.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls GameKitMBS.loadFriendsCompleted.

Once this call is completed, the friends property is set to the same list of players returned in the completion event.

GKLocalPlayerMBS.SetAuthenticateHandler(tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 13.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the handler called to process an authentication-related event with GameKitMBS.authenticateHandler.

Calls later GameKitMBS.authenticateHandler.
Available on Mac OS X 10.8.2 and newer.

Some examples using this method:

GKLocalPlayerMBS.setDefaultLeaderboardCategoryID(categoryID as string, tag as Variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 13.0 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the category identifier for the local player's default leaderboard.

categoryID: The category ID string for one of your game's leaderboards.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls GameKitMBS.setDefaultLeaderboardCategoryIDCompleted event.

The default leaderboard is configured in iTunes Connect as part of configuring your game's leaderboards. All players normally start with this leaderboard as the default leaderboard. Calling this method changes the default leaderboard only for the local player.

Available on Mac OS X 10.8.2 and newer.

The items on this page are in the following plugins: MBS MacFrameworks Plugin.


The biggest plugin in space...