Skip to main content

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

ParameterTypeRequiredDescription
account_tokenstringRequiredSocial login token (Apple ID Token)
account_typestringRequiredAccount 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

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

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.

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