Skip to main content

Set up custom account information (SetAccountInfo)

AndroidiOSWindows
If you're using Unreal Engine, see SetAccountInfo for Unreal Engine 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, or it will trigger auto-login 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 original custom account channel information, lang_type parameter should remain consistent with the SetLanguage above.)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. Auto-login must be called in the callback of LevelInfinite.Init after receiving GN_READY.

Function Definition

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

Input Parameters

ParametersTypeExplanation
channelStringChannel for the custom account, related to the platform account, e.g., CustomAccount, EGame, etc.
channelIdintACCOUNT_PLAT_TYPE assigned by the Player Network Console
langTypestringLanguage type (RFC 4646), e.g., "en".Used to define the language for sending emails and SMS
For details, please see Language Type Definition.
accountPlatTypeintACCOUNT_PLAT_TYPE assigned by the Player Network Console
extraJsonintExtended information

Code example

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.