Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

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

💬 Ask a question or report a problem