Android Registration and Authentication
Use Apple ID for account registration and authentication.
Call Information
OpenAppleID(PlayNANOODelegate callback, Action<string> closeCallback) {}
// Apple ID 토큰 획득을 원하는 경우
OpenAppleID(ServiceDelegate callback, Action<string> closeCallback) {}
Call Details
| Parameter | Description | Type |
|---|---|---|
| callback | Communication Result | PlayNANOODelegate |
| closeCallback | WebView callback | Action<string> |
Request
using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Start()
{
plugin = Plugin.GetInstance();
}
public void SignIn()
{
plugin.OpenAppleID(OnResult, OnClose);
void OnResult(string status, string errorCode, string jsonString, Dictionary<string, object> values) {
if (status == Configure.PN_API_STATE_SUCCESS)
{
Debug.Log(values["access_token"].ToString());
Debug.Log(values["refresh_token"].ToString());
Debug.Log(values["uuid"].ToString());
Debug.Log(values["openID"].ToString());
Debug.Log(values["nickname"].ToString());
Debug.Log(values["linkedID"].ToString());
Debug.Log(values["linkedType"].ToString());
Debug.Log(values["country"].ToString());
Debug.Log(values["purchaseCount"].ToString());
Debug.Log(values["purchaseTotalPrice"].ToString());
Debug.Log(values["purchaseCurrencyCode"].ToString());
Debug.Log(values["purchaseVoidedCount"].ToString());
Debug.Log(values["purchaseVoidedTotalPrice"].ToString());
Debug.Log(values["purchaseVoidedCurrencyCode"].ToString());
Debug.Log(values["country"].ToString());
Debug.Log(values["timezone"].ToString());
Debug.Log(values["offset"].ToString());
Debug.Log(values["joinPeriod"].ToString());
}
else
{
if (values != null)
{
if (values["ErrorCode"].ToString() == "30007")
{
Debug.Log(values["WithdrawalKey"].ToString());
}
else if (values["ErrorCode"].ToString() == "70002")
{
Debug.Log(values["BlockKey"].ToString());
}
else
{
Debug.Log("Fail");
}
}
else
{
Debug.Log("Fail");
}
}
}
void OnClose(string response) {
Debug.Log("Close Callback");
}
// Apple ID 토큰 획득을 원하는 경우 아래의 코드를 활용하세요.
plugin.OpenAppleID(GetAppleToken, OnClose);
}
public void GetAppleToken(string token)
{
Debug.Log(token);
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"Token" : {
"AccessToken" : "String",
"RefreshToken" : "String"
},
"Player" : {
"UserUniqueID" : "String",
"OpenID" : "String",
"Nickname" : "String",
"LinkedID" : "String",
"LinkedType" : "String",
"PurchaseCount" : "Integer",
"PurchaseTotalPrice" : "Double",
"PurchaseCurrencyCode" : "String",
"PurchaseVoidedCount" : "Integer",
"PurchaseVoidedTotalPrice" : "Double",
"PurchaseVoidedCurrencyCode" : "String",
"Country" : "String",
"Timezone" : "String",
"Offset" : "Integer",
"JoinPeriod" : "Integer"
}
}
Response Details
| Data Key | Description | Type |
|---|---|---|
| Token.AccessToken | Player access token | string |
| Token.RefreshToken | Player refresh token | string |
| Player.UserUniqueID | Player unique ID | string |
| Player.OpenID | Player unique open ID | string |
| Player.Nickname | Player nickname | string |
| Player.LinkedID | Player linked ID | string |
| Player.LinkedType | Player link type | string |
| Player.PurchaseCount | Player purchase count | integer |
| Player.PurchaseTotalPrice | Player cumulative purchase amount | double |
| Player.PurchaseCurrencyCode | Player purchase currency | string |
| Player.PurchaseVoidedCount | Player refund count | integer |
| Player.PurchaseVoidedTotalPrice | Player cumulative refund amount | double |
| Player.PurchaseVoidedCurrencyCode | Player refund currency | string |
| Player.Country | Player country code | string |
| Player.Timezone | Player country timezone | string |
| Player.Offset | Player timezone offset (based on UTC) | integer |
| Player.JoinPeriod | Player membership duration | integer |
| WithdrawalKey | Withdrawal account lookup key | string |
Error Information
If player information does not exist. ErrorCode : 30000 ErrorMessage : NotFoundAccountException
If player information is being used on another device ErrorCode : 30006 ErrorMessage : DuplicatedDeviceException
If the player has requested withdrawal ErrorCode : 30007 ErrorMessage : WithDrawalException