GetUserInfoV2
public BackendReturnObject GetUserInfoV2();
Description
The user's metadata stored in the server is retrieved.\ V2 adds group name, guild inDate, and Last login time to the return value of the existing API.
User's metadata
- Nickname
- User inDate
- gamer_id (the user's unique value used in the console)
- Login type (custom, federation)
- Federation account ID (Google/Apple/Facebook federation ID)
- Email to find custom account ID/PW
- Country code
- Group name
- Guild inDate
- Last login time
Example
Synchronous
BackendReturnObject bro = Backend.BMember.GetUserInfoV2();
string nickname = bro.GetReturnValuetoJSON()["row"]["nickname"].ToString();
Asynchronous
Backend.BMember.GetUserInfoV2((callback) =>
{
string nickname = callback.GetReturnValuetoJSON()["row"]["nickname"].ToString();
});
SendQueue
SendQueue.Enqueue(Backend.BMember.GetUserInfoV2, (callback) =>
{
string nickname = callback.GetReturnValuetToJSON()["row"]["nickname"].ToString();
});
ReturnCase
Success cases
When loaded successfully\ statusCode : 200\ message : Success\ returnValue : refer to GetReturnValuetoJSON
GetReturnValuetoJSON
In the case of success, the information of the logged-in user is displayed.
{
"row": {
"gamerId":"123456a0-7890-11ab-22cd-33f4567fa89" // user's gamer_id
"countryCode": "KR", // null if country code is not set
"nickname": "TestUser1", // null if nickname is not set
"inDate": "2020-06-23T05:54:29.743Z", // user's inDate
"propertyGroup": "USA", // null if there is no group,
"guildInDate": null, // null if there is no guild
"lastLogin": "2025-04-24T02:58:49.730Z", // last login time
"emailForFindPassword": "backend@afidev.com", // email to find ID and PW of a custom account. null if not registered
"subscriptionType": "customSignUp", // custom, federation type
"federationId": null // federation ID for Google, Apple, and Facebook. null if custom account
}
}
Sample Code
public class UserInfo
{
public string gamerId;
public string countryCode;
public string nickname;
public string inDate;
public string propertyGroup;
public string guildInDate;
public string lastLogin;
public string emailForFindPassword;
public string subscriptionType;
public string federationId;
public override string ToString()
{
return $"gamerId: {gamerId}\n" +
$"countryCode: {countryCode}\n" +
$"nickname: {nickname}\n" +
$"inDate: {inDate}\n" +
$"propertyGroup: {propertyGroup}\n" +
$"guildInDate: {guildInDate}\n" +
$"lastLogin: {lastLogin}\n" +
$"emailForFindPassword: {emailForFindPassword}\n" +
$"subscriptionType: {subscriptionType}\n" +
$"federationId: {federationId}\n";
}
}
public void GetUserInfoTest()
{
var bro = Backend.BMember.GetUserInfo();
if(!bro.IsSuccess())
{
Debug.LogError("An error occurred : " + bro.ToString());
return;
}
LitJson.JsonData userInfoJson = bro.GetReturnValuetoJSON()["row"];
UserInfo userInfo = new UserInfo();
userInfo.gamerId = userInfoJson["gamerId"].ToString();
userInfo.countryCode = userInfoJson["countryCode"].ToString();
userInfo.nickname = userInfoJson["nickname"].ToString();
userInfo.inDate = userInfoJson["inDate"].ToString();
userInfo.propertyGroup = userInfoJson["propertyGroup"]?.ToString();
userInfo.guildInDate = userInfoJson["guildInDate"].ToString();
userInfo.lastLogin = userInfoJson["lastLogin"].ToString();
userInfo.emailForFindPassword = userInfoJson["emailForFindPassword"]?.ToString();
userInfo.subscriptionType = userInfoJson["subscriptionType"].ToString();
userInfo.federationId = userInfoJson["federationId"]?.ToString();
Debug.Log(userInfo.ToString());
}