안드로이드 가입 및 인증
애플 아이디를 활용하여 회원 가입 및 인증을 합니다.
호출 정보
OpenAppleID(PlayNANOODelegate callback, Action<string> closeCallback) {}
// Apple ID 토큰 획득을 원하는 경우
OpenAppleID(ServiceDelegate callback, Action<string> closeCallback) {}
호출 상세 정보
파라미터 | 설명 | 타입 |
---|---|---|
callback | 통신 결과 | PlayNANOODelegate |
closeCallback | 웹뷰 콜백 | Action<string> |
요청
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);
}
}
통신 결과
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"
}
}
통신 결과 상세 정보
데이터키 | 설명 | 타입 |
---|---|---|
Token.AccessToken | 플레이어 접속 토큰 | string |
Token.RefreshToken | 플레이어 갱신 토큰 | string |
Player.UserUniqueID | 플레이어 고유 식별 아이디 | string |
Player.OpenID | 플레이어 고유 식별 오픈 아이디 | string |
Player.Nickname | 플레이어 닉네임 | string |
Player.LinkedID | 플레이어 연결 식별 아이디 | string |
Player.LinkedType | 플레이어 연결 타입 | string |
Player.PurchaseCount | 플레이어 결제 횟수 | integer |
Player.PurchaseTotalPrice | 플레이어 결제 누적 금액 | double |
Player.PurchaseCurrencyCode | 플레이어 결제 화폐 | string |
Player.PurchaseVoidedCount | 플레이어 결제 환불 횟수 | integer |
Player.PurchaseVoidedTotalPrice | 플레이어 결제 환불 누적 금액 | double |
Player.PurchaseVoidedCurrencyCode | 플레이어 결제 환불 화폐 | string |
Player.Country | 플레이어 국가 코드 | string |
Player.Timezone | 플레이어 국가 타임존 | string |
Player.Offset | 플레이어 타임존 시간차이 (UTC 기준) | integer |
Player.JoinPeriod | 플레이어 가입 기간 | integer |
WithdrawalKey | 탈퇴 계정 조회 키 | string |
에러 정보
플레이어 정보가 존재하지 않을 경우.
ErrorCode : 30000
ErrorMessage : NotFoundAccountException
플레이어 정보가 다른 디바이스에서 사용 중인 경우
ErrorCode : 30006
ErrorMessage : DuplicatedDeviceException
플레이어가 탈퇴를 신청한 경우
ErrorCode : 30007
ErrorMessage : WithDrawalException