iOS Sign Up and Authentication
Sign up and authenticate using Apple ID.
URL Confirmation
This API uses the service-account.playnanoo.com domain.
Register Apple Authentication SDK
Download and import the Apple Authentication Unity Package into your project.
Download Apple Authentication Unity Package
API Information
- URL:
https://service-account.playnanoo.com/api/v20240101/social/signin - Method:
PUT - Authentication Required: No
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account_token | string | Required | Social login token (Apple ID Token) |
| account_type | string | Required | Account type (PN_ACCOUNT_APPLE_ID = "APPLE ID") |
DeviceInfo Inheritance
The Req class for this API inherits from DeviceInfo. All properties of DeviceInfo are automatically included.
Response Data
Res Class
| Field | Type | Description |
|---|---|---|
| Token | SerializeTokenData | Token information |
| Player | SerializePlayerData | Player information |
SerializeTokenData Structure
| Field | Type | Description |
|---|---|---|
| AccessToken | string | Access token |
| RefreshToken | string | Refresh token |
SerializePlayerData Structure
| Field | Type | Description |
|---|---|---|
| UserUniqueID | string | User unique ID |
| OpenID | string | Open ID |
| Nickname | string | Nickname |
| LinkedID | string | Linked ID |
| LinkedType | string | Linked type |
| PurchaseCount | int | Purchase count |
| PurchaseCurrencyCode | string | Purchase currency code |
| PurchaseTotalPrice | double | Total purchase amount |
| PurchaseVoidedCount | int | Refund count |
| PurchaseVoidedCurrencyCode | string | Refund currency code |
| PurchaseVoidedTotalPrice | double | Total refund amount |
| Country | string | Country |
| Timezone | string | Timezone |
| Offset | int | Time offset |
| JoinPeriod | int | Join period |
Unity C# Implementation
using AppleAuth;
using AppleAuth.Native;
using AppleAuth.Enums;
using AppleAuth.Extensions;
using AppleAuth.Interfaces;
using UnityEngine;
using System.Text;
public class AppleSignInExample : MonoBehaviour
{
IAppleAuthManager _appleAuthManager;
void Start()
{
if (AppleAuthManager.IsCurrentPlatformSupported)
{
var deserializer = new PayloadDeserializer();
_appleAuthManager = new AppleAuthManager(deserializer);
}
}
private void Update()
{
_appleAuthManager?.Update();
}
public void SignIn()
{
var loginArgs = new AppleAuthLoginArgs();
_appleAuthManager.LoginWithAppleId(
loginArgs,
credential =>
{
var appleIdCredential = credential as IAppleIDCredential;
if (appleIdCredential != null)
{
string idToken = Encoding.UTF8.GetString(
appleIdCredential.IdentityToken,
0,
appleIdCredential.IdentityToken.Length
);
// SocialSignin API 호출
SocialSignin(idToken);
}
},
error =>
{
var authorizationErrorCode = error.GetAuthorizationErrorCode();
Debug.LogError($"Apple 인증 실패: {authorizationErrorCode}");
}
);
}
private void SocialSignin(string token)
{
//SocialSignIn(token, PN_ACCOUNT_APPLE_ID);
}
}
How to Use
1. Start Apple Login
SignIn();
The Apple login window is displayed and the user authenticates with their Apple account.
2. Link Account with Token
After authentication is complete, call the PlayNANOO API with the token received in the SendTokenToServer method:
New Login (SocialSignIn)
public void SocialSignIn(string token, string accountType)
{
// Apple 계정으로 처음 로그인
//accountType : PN_ACCOUNT_APPLE_ID
}
References
- Account Type Value:
PN_ACCOUNT_APPLE_ID = "APPLE ID"- For detailed information, see Etc > Account Type Information - Member Conversion: See Guest Link > Member Conversion documentation