One Logo Pool Ball
GameKit · IOS API REFERENCE

GKLocalPlayer

class · iOS 4.1+ · SDK 27.1

class GKLocalPlayer

Members (29)

get · iOS 4.1+

local

TypeScript
static get local(): GKLocalPlayer
Swift declaration
class var local: GKLocalPlayer { get }
method · iOS 8.0+

deleteSavedGames

TypeScript
deleteSavedGames(name: string, handler?: (((arg0: (NativeError) | null) => void)) | null): void
Swift declaration
func deleteSavedGames(withName name: String) async throws
method · iOS 13.5+

fetchItems

TypeScript
fetchItems(completionHandler?: (((arg0: (string) | null, arg1: (ArrayBuffer) | null, arg2: (ArrayBuffer) | null, arg3: number, arg4: (NativeError) | null) => void)) | null): void
Swift declaration
func fetchItemsForIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64)
method · iOS 8.0+

fetchSavedGames

TypeScript
fetchSavedGames(handler?: (((arg0: (Array<GKSavedGame>) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func fetchSavedGames() async throws -> [GKSavedGame]
method · iOS 7.0+ · Deprecated in iOS 13.5

generateIdentityVerificationSignature

TypeScript
generateIdentityVerificationSignature(completionHandler?: (((arg0: (string) | null, arg1: (ArrayBuffer) | null, arg2: (ArrayBuffer) | null, arg3: number, arg4: (NativeError) | null) => void)) | null): void
Swift declaration
func generateIdentityVerificationSignature() async throws -> (URL, Data, Data, UInt64)
init

init

TypeScript
static init(): GKLocalPlayer
Swift declaration
init()
method · iOS 4.1+

loadChallengableFriends

TypeScript
loadChallengableFriends(completionHandler?: (((arg0: (Array<GKPlayer>) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func loadChallengableFriends() async throws -> [GKPlayer]
method · iOS 7.0+ · Deprecated in iOS 26.2

loadDefaultLeaderboardIdentifier

TypeScript
loadDefaultLeaderboardIdentifier(completionHandler?: (((arg0: (string) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func loadDefaultLeaderboardIdentifier() async throws -> String
method · iOS 8.0+ · Deprecated in iOS 10.0

loadFriendPlayers

TypeScript
loadFriendPlayers(completionHandler?: (((arg0: (Array<GKPlayer>) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func loadFriendPlayers(completionHandler: (@Sendable ([GKPlayer]?, (any Error)?) -> Void)? = nil)
method · iOS 14.5+

loadFriends

TypeScript
loadFriends(completionHandler: ((arg0: (Array<GKPlayer>) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadFriends() async throws -> [GKPlayer]
method · iOS 14.5+

loadFriendsAuthorizationStatus

TypeScript
loadFriendsAuthorizationStatus(completionHandler: ((arg0: GKFriendsAuthorizationStatus, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadFriendsAuthorizationStatus() async throws -> GKFriendsAuthorizationStatus
method · iOS 4.1+ · Deprecated in iOS 8.0

loadFriendsObsoleted

TypeScript
loadFriendsObsoleted(completionHandler?: (((arg0: (Array<string>) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func loadFriendsObsoleted(completionHandler: (@Sendable ([String]?, (any Error)?) -> Void)? = nil)
method · iOS 14.5+

loadFriends

TypeScript
loadFriendsIdentifiedByCompletionHandler(identifiers: Array<string>, completionHandler: ((arg0: (Array<GKPlayer>) | null, arg1: (NativeError) | null) => void)): void
Swift declaration
func loadFriends(identifiedBy identifiers: [String]) async throws -> [GKPlayer]
method · iOS 10.0+

loadRecentPlayers

TypeScript
loadRecentPlayers(completionHandler?: (((arg0: (Array<GKPlayer>) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func loadRecentPlayers() async throws -> [GKPlayer]
method · iOS 15.0+

presentFriendRequestCreator

TypeScript
presentFriendRequestCreator(viewController: _UIKit_UIViewController): void
Swift declaration
func presentFriendRequestCreator(from viewController: UIViewController) throws
method · iOS 7.0+

register

TypeScript
register(listener: SDKHandle): void
Swift declaration
func register(_ listener: any GKLocalPlayerListener)
method · iOS 8.0+

resolveConflictingSavedGames

TypeScript
resolveConflictingSavedGames(conflictingSavedGames: Array<GKSavedGame>, data: ArrayBuffer, handler?: (((arg0: (Array<GKSavedGame>) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func resolveConflictingSavedGames(_ conflictingSavedGames: [GKSavedGame], with data: Data) async throws -> [GKSavedGame]
method · iOS 8.0+

saveGameData

TypeScript
saveGameData(data: ArrayBuffer, name: string, handler?: (((arg0: (GKSavedGame) | null, arg1: (NativeError) | null) => void)) | null): void
Swift declaration
func saveGameData(_ data: Data, withName name: String) async throws -> GKSavedGame
method · iOS 7.0+ · Deprecated in iOS 26.2

setDefaultLeaderboardIdentifier

TypeScript
setDefaultLeaderboardIdentifier(leaderboardIdentifier: string, completionHandler?: (((arg0: (NativeError) | null) => void)) | null): void
Swift declaration
func setDefaultLeaderboardIdentifier(_ leaderboardIdentifier: String) async throws
method · iOS 7.0+

unregisterAllListeners

TypeScript
unregisterAllListeners(): void
Swift declaration
func unregisterAllListeners()
method · iOS 7.0+

unregisterListener

TypeScript
unregisterListener(listener: SDKHandle): void
Swift declaration
func unregisterListener(_ listener: any GKLocalPlayerListener)
get · iOS 6.0+

authenticateHandler

TypeScript
get authenticateHandler(): (((arg0: (_UIKit_UIViewController) | null, arg1: (NativeError) | null) => Promise<void>)) | null
Swift declaration
var authenticateHandler: ((UIViewController?, (any Error)?) -> Void)? { get set }
set · iOS 6.0+

authenticateHandler

TypeScript
set authenticateHandler(value: (((arg0: (_UIKit_UIViewController) | null, arg1: (NativeError) | null) => void)) | null)
Swift declaration
var authenticateHandler: ((UIViewController?, (any Error)?) -> Void)? { get set }
get · iOS 4.1+

isAuthenticated

TypeScript
get isAuthenticated(): boolean
Swift declaration
var isAuthenticated: Bool { get }
get · iOS 4.1+ · Deprecated in iOS 8.0

friends

TypeScript
get friends(): (Array<string>) | null
Swift declaration
var friends: [String]? { get }
get · iOS 15.0+

isPresentingFriendRequestViewController

TypeScript
get isPresentingFriendRequestViewController(): boolean
Swift declaration
var isPresentingFriendRequestViewController: Bool { get }
get · iOS 13.0+

isMultiplayerGamingRestricted

TypeScript
get isMultiplayerGamingRestricted(): boolean
Swift declaration
var isMultiplayerGamingRestricted: Bool { get }
get · iOS 14.0+

isPersonalizedCommunicationRestricted

TypeScript
get isPersonalizedCommunicationRestricted(): boolean
Swift declaration
var isPersonalizedCommunicationRestricted: Bool { get }
get · iOS 4.1+

isUnderage

TypeScript
get isUnderage(): boolean
Swift declaration
var isUnderage: Bool { get }

Skipped declarations

No declarations were skipped in this snapshot.

All GameKit types →