Skip to main content

Set up custom account information (SetAccountInfo)

AndroidiOSWindows
If you're using the Unity engine, see SetAccountInfo for Unity SDK.

To create a custom account, first call SetAccountInfo to set necessary information.This method has no callback.If you don't call this method first, and use other methods to create a custom account, an error message will appear on the console.

caution
  1. After calling LevelInfinite.AutoLogin, do not call the old auto-login interface INTLAPI.AutoLogin; otherwise, auto-login will execute twice.
  2. If the game is linked to a custom account, ensure the local login status before calling auto-login.If the login status is a custom account, INTLAPI.SetAccountInfo needs to be invoked.(The channel information of the original self-built account; the lang_type parameter should be consistent with the above SetLanguage.)If the local login status is another channel, there's no need for SetAccountInfo since it was called during LI PASS initialization.Ignore this note if the game hasn't integrated with a custom account.
  3. AutoLogin must be called in the callback of LevelInfinite.Init after receiving GN_READY.

Function Definition

UFUNCTION(BlueprintCallable, Category = "INTLSDKAPI")
static bool SetAccountInfo(
const EINTLLoginChannel Channel,
const int32 ChannelID,
const FString LangType,
const int32 AccountPlatType);

Input Parameters

ParametersTypeExplanation
ChannelEINTLLoginChannelSelf-built account channel, related to platform account, such as CustomAccount, EGame
ChannelIDint32ACCOUNT_PLAT_TYPE assigned by Player Network Console
LangTypeFStringLanguage type (RFC 4646), e.g., "en".Used to define the language for sending emails and SMS
For details, see Language Type Definition.
AccountPlatTypeint32ACCOUNT_PLAT_TYPE assigned by Player Network Console

Code example

UINTLSDKAPI::SetAccountInfo(EINTLLoginChannel::kChannelCustomAccount,  {YOUR_ACCOUNT_PLAT_TYPE}, "en", {YOUR_ACCOUNT_PLAT_TYPE});
  • Replace {YOUR_ACCOUNT_PLAT_TYPE} with ACCOUNT_PLAT_TYPE.