Skip to main content

Initialization (Init)

AndroidiOSWindows
Deprecated in: LI PASS V1.06.00
If you are using the Unity engine, refer to Unity SDK's Init.

It is recommended to initialize LI PASS at game launch.

  • LI PASS V1.06 to LI PASS V1.15, you can call InitLI
  • LI PASS 1.16 and later versions, you can call InitLIP

Function Definition

UFUNCTION(BlueprintCallable, Category = "LevelInfinite")
static int Init(UGameInstance* instance, const FString &host, const FLIUserData& userData, bool isTest);

Input Parameters

ParametersTypeExplanation
instanceUGameInstanceUE GameInstance
hostFStringProduction URL: https://sg-vas.intlgame.com
Test URL: https://test-vas.intlgame.com
userDataFLIUserDataThis rule must be consistent with the one configured in the Player Network console to get the correct resources.
For more information, see UserData.
isTestboolDoes not affect the LI PASS environment; the game doesn't need to worry, just pass false

User data structure

ParameterTypeExplanation
GameIdintActual Game ID
ChannelIdStringLI PASS Channel ID 131
OpenIDStringOpenID, fixed as FFFFFFFFFFFFFF
LangTypeStringLanguage type affecting multi-language UI display, provide as needed.
RegionStringNumeric codes of countries or regions as per ISO 3166-1
For example, 156 represents China, and 040 represents Austria.
AppVersionstringGame version number

Other parameters have no special requirements. Pass values when available.

Code example

FString host = TEXT("https://test-vas.intlgame.com");
FLIUserData userData = GetUserData();
ULevelInfiniteAPI::Init(GetGameInstance<UGameInstance>(), host, userData, false);