Skip to main content

SetAccountInfo

AndroidiOSWindows
If you were looking for the method for use with Unreal Engine, see SetAccountInfo for Unreal Engine SDK.

To create a custom account, the first step is to call SetAccountInfo to set necessary information. This method does not have a callback. If you do not call this method first, and use other methods to create your own account, an error message will be appear on the console.

caution
  1. After calling LevelInfinite.AutoLogin, do not call the old automatic login interface INTLAPI.AutoLogin, otherwise it will automatically log in twice.
  2. If the game is linked to a custom account, determine the local login status before calling automatic login. If the login status is a custom account, it is necessary to call INTLAPI.SetAccountInfo. (The channel information of the original custom account, where the lang_type parameter and the above SetLanguage should remain consistent). If the local login status is another channel, there is no need to call SetAccountInfo, because SetAccountInfo has been called when LI PASS is initialized. If the game is not integrated to a custom account, ignore this note.
  3. AutoLogin must be called after receiving GN_READY in the LevelInfinite.Init callback.

Function definition

public static void SetAccountInfo(
string channel,
int channelId,
string langType,
int accountPlatType,
string extraJson="{}");

Input parameters

ParameterTypeDescription
channelstringChannel of a custom account, which is associated with the platform account, such as CustomAccount or EGame
channelIdintACCOUNT_PLAT_TYPE assigned by Player Network Console
langTypestringLanguage type (RFC 4646), such as "en". It defines the language used to send emails and SMS messages.
For details, see Language Type Definition.
accountPlatTypeintACCOUNT_PLAT_TYPE assigned by Player Network Console
extraJsonintExtended information

Code sample

string channel = INTLChannel.CustomAccount;
int channelId = {YOUR_ACCOUNT_PLAT_TYPE};
string langType = "zh-Hans";
int accountPlatType = {YOUR_ACCOUNT_PLAT_TYPE};

INTLAPI.SetAccountInfo(channel, channelId, langType, accountPlatType);
  • Replace {YOUR_ACCOUNT_PLAT_TYPE} with ACCOUNT_PLAT_TYPE.