Skip to main content

Guest Login

This API allows login with a guest account.

URL Confirmation

This API uses the service-account.playnanoo.com domain.

API Information

  • URL: https://service-account.playnanoo.com/api/v20240401/guest/signin
  • Method: PUT
  • Authentication Required: No

Request Parameters

ParameterTypeRequiredDescription
linked_idstringRequiredLinked ID (device unique ID)
platformstringRequiredPlatform (e.g., "aos", "ios")
device_idstringRequiredDevice unique ID
device_modelstringRequiredDevice model name
device_osstringRequiredDevice OS
device_languagestringRequiredDevice language (e.g., "KO", "EN")
DeviceInfo Inheritance

The Req class for this API inherits from DeviceInfo. All properties of DeviceInfo are automatically included.

Response Data

Res Class

FieldTypeDescription
TokenSerializeTokenDataToken information
PlayerSerializePlayerDataPlayer information

SerializeTokenData Structure

FieldTypeDescription
AccessTokenstringAccess token
RefreshTokenstringRefresh token

SerializePlayerData Structure

FieldTypeDescription
UserUniqueIDstringUser unique ID
OpenIDstringOpen ID
NicknamestringNickname
LinkedIDstringLinked ID
LinkedTypestringLinked type
PurchaseCountintPurchase count
PurchaseCurrencyCodestringPurchase currency code
PurchaseTotalPricedoubleTotal purchase amount
PurchaseVoidedCountintRefund count
PurchaseVoidedCurrencyCodestringRefund currency code
PurchaseVoidedTotalPricedoubleTotal refund amount
CountrystringCountry
TimezonestringTimezone
OffsetintTime offset
JoinPeriodintJoin period

Unity C# Implementation

BaseResponse Class

Base class for all API responses.

public class BaseResponse
{
public string ErrorCode;
public string Message;
public string WithdrawalKey;
public string BlockKey;
}

Field descriptions:

  • ErrorCode: Error code
  • Message: Error message
  • WithdrawalKey: Key required for recovery when the account is in withdrawal grace period (only provided for accounts pending withdrawal)
  • BlockKey: Key provided when the account is blocked (only provided for blocked accounts)

Guest Login Class

using System;
using System.Collections;
using UnityEngine.Networking;

public class GuestSignin
{
static string path = "https://service-account.playnanoo.com/api/v20240401/guest/signin";

[Serializable]
public class Req : DeviceInfo
{
public string linked_id;

public IEnumerator Send(
string linked_id,
Action<Res> onSuccess,
Action<BaseResponse> onError)
{
if (!string.IsNullOrEmpty(linked_id)) this.linked_id = linked_id;

yield return HttpClient.Send<Req, Res>(
UnityWebRequest.kHttpVerbPUT,
path,
requireToken: false,
body: this,
onSuccess: onSuccess,
onError: onError
);
}
}

[Serializable]
public class Res : BaseResponse
{
public SerializeTokenData Token;
public SerializePlayerData Player;
}

[Serializable]
public class SerializeTokenData
{
public string AccessToken;
public string RefreshToken;
}

[Serializable]
public class SerializePlayerData
{
public string UserUniqueID;
public string OpenID;
public string Nickname;
public string LinkedID;
public string LinkedType;
public int PurchaseCount;
public string PurchaseCurrencyCode;
public double PurchaseTotalPrice;
public int PurchaseVoidedCount;
public string PurchaseVoidedCurrencyCode;
public double PurchaseVoidedTotalPrice;
public string Country;
public string Timezone;
public int Offset;
public int JoinPeriod;
}
}

Usage Example

public void GuestLogin()
{
GuestSignin.Req req = new GuestSignin.Req();

StartCoroutine(req.Send(
linked_id: SystemInfo.deviceUniqueIdentifier,
onSuccess: res =>
{
// 토큰
Debug.Log($"AccessToken: {res.Token.AccessToken}");
Debug.Log($"RefreshToken: {res.Token.RefreshToken}");

// 플레이어 정보
Debug.Log($"UserUniqueID: {res.Player.UserUniqueID}");
Debug.Log($"OpenID: {res.Player.OpenID}");
Debug.Log($"Nickname: {res.Player.Nickname}");
Debug.Log($"LinkedID: {res.Player.LinkedID}");
Debug.Log($"LinkedType: {res.Player.LinkedType}");
Debug.Log($"Country: {res.Player.Country}");

// 구매 관련
Debug.Log($"PurchaseCount: {res.Player.PurchaseCount}");
Debug.Log($"PurchaseTotalPrice: {res.Player.PurchaseTotalPrice}");
Debug.Log($"PurchaseCurrencyCode: {res.Player.PurchaseCurrencyCode}");
Debug.Log($"Timezone: {res.Player.Timezone}");
Debug.Log($"Offset: {res.Player.Offset}");
Debug.Log($"JoinPeriod: {res.Player.JoinPeriod}");
},
onError: (error) =>
{
Debug.LogError($"게스트 로그인 실패: [{error.ErrorCode}] [{error.Message}]");
}
));
}
Getting Device Information

In Unity, you can use the SystemInfo class to get device information:

  • SystemInfo.deviceUniqueIdentifier: Device unique ID
  • SystemInfo.deviceModel: Device model name
  • SystemInfo.operatingSystem: Operating system information