SetAccountInfo
AndroidiOSWindows
If you were looking for the method for use with Unreal Engine, see SetAccountInfo for Unreal Engine SDK.
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
- After calling LevelInfinite.AutoLogin, do not call the old automatic login interface INTLAPI.AutoLogin, otherwise it will automatically log in twice.
- 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 thelang_type
parameter and the above SetLanguage should remain consistent). If the local login status is another channel, there is no need to callSetAccountInfo
, becauseSetAccountInfo
has been called when LI PASS is initialized. If the game is not integrated to a custom account, ignore this note. - AutoLogin must be called after receiving
GN_READY
in theLevelInfinite.Init
callback.
Function definition
public static void SetAccountInfo(
string channel,
int channelId,
string langType,
int accountPlatType,
string extraJson="{}");
Input parameters
Parameter | Type | Description |
---|---|---|
channel | string | Channel of a custom account, which is associated with the platform account, such as CustomAccount or EGame |
channelId | int | ACCOUNT_PLAT_TYPE assigned by Player Network Console |
langType | string | Language type (RFC 4646), such as "en". It defines the language used to send emails and SMS messages. For details, see Language Type Definition. |
accountPlatType | int | ACCOUNT_PLAT_TYPE assigned by Player Network Console |
extraJson | int | Extended 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
.