Contents

getCurrentSignedInPlayer(forContainer:completionHandler:)

Returns player information for the currently signed-in player.

Declaration

class func getCurrentSignedInPlayer(forContainer containerName: String?, completionHandler handler: @escaping  @Sendable (GKCloudPlayer?, (any Error)?) -> Void)
class func currentSignedInPlayer(forContainer containerName: String?) async throws -> GKCloudPlayer

Parameters

  • containerName:

    String containing a unique container name associated with the app.

  • handler:

    A block that is called after the player information is retrieved.

    player

    The GKCloudPlayer object representing the currently signed-in player.

    error

    If an error occurred, this parameter holds an error object that explains the error. Otherwise, the value of this parameter is nil. See GameKit Constantsfor a list of error codes specific to GameKit.

Discussion

The container name must be a unique string associated with the app.