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.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4    Statistic    FMM    Blog  

GameKit.Initialize

Initialized GameKit.

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

Parameters

none

Result

Returns OK or error.

Description

Initialized GameKit.
Loads the framework, setups script triggers and loads local player.
Must be called once before doing any other method.

Examples

Initialize GameKit:

# Try to init GameKit
Set Variable [ $r ; Value: MBS( "GameKit.Initialize" ) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "Failed to initialize GameKit." ; $r ]
    Exit Script [ Text Result: ]
End If
# Set script to call when player changes
Set Variable [ $r ; Value: MBS( "GameKit.SetPlayerDidChangeScriptTrigger"; Get(FileName); "PlayerChanged" ) ]
# 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.GameCenterView.ShowBannerWithTitle - GameKit.Leaderboard.GetPlayerScope

💬 Ask a question or report a problem