Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

GameKit.LocalPlayer.Authenticate

Authenticates the local user.

Component Version macOS Windows Linux Server iOS SDK
GameKit 8.5 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "GameKit.LocalPlayer.Authenticate" )

Parameters

none

Result

Returns OK or error.

Description

Authenticates the local user.
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. After you set a handler, authentication begins automatically and is repeated when your game moves to the background and then back to the foreground.

Check later status via GameKit.LocalPlayer.isAuthenticated and GameKit.LocalPlayer.AuthenticateError functions.

Examples

Login if needed:

If [ MBS( "GameKit.LocalPlayer.isAuthenticated" ) = 0 ]
    # Show Login dialog
    Set Variable [ $r ; Value: MBS( "GameKit.LocalPlayer.Authenticate" ) ]
End If

See also

This function is free to use.

Created 5th November 2018, last changed 8th November 2018


GameKit.LocalPlayer - GameKit.LocalPlayer.AuthenticateError