Skip to main content

Account Registration and Authentication

Sign up and authenticate using a Facebook account. Compatible with both iOS and Android.

URL Confirmation

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

API Information

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

Request Parameters

ParameterTypeRequiredDescription
account_tokenstringRequiredSocial login token (Facebook Access Token)
account_typestringRequiredAccount type (PN_ACCOUNT_FACEBOOK = "FACEBOOK")
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 UnityEngine;
using Facebook.Unity;
using System.Collections.Generic;

public class FacebookSignInExample : MonoBehaviour
{
void Start()
{
if (!FB.IsInitialized)
{
FB.Init(OnFBInitComplete, OnFBHideUnity);
}
else
{
FB.ActivateApp();
}
}

void OnFBInitComplete()
{
if (FB.IsInitialized)
{
FB.ActivateApp();
}
else
{
Debug.Log("Failed to Initialize the Facebook SDK");
}
}

void OnFBHideUnity(bool isShow)
{
Time.timeScale = isShow ? 1 : 0;
}

public void FacebookSignIn()
{
var para = new List<string>() { "public_profile", "email" };
FB.LogInWithReadPermissions(para, FacebookAuthCallback);
}

void FacebookAuthCallback(ILoginResult result)
{
if (FB.IsLoggedIn)
{
// SocialSignin API 호출
SocialSignin(result.AccessToken.TokenString);
}
else
{
Debug.Log("Login Cancel");
}
}

private void SocialSignin(string token)
{
//SocialSignIn(token, PN_ACCOUNT_FACEBOOK);
}
}

How to Use

1. Start Facebook Login

FacebookSignIn();

The Facebook login window is displayed and the user authenticates with their Facebook account.

After authentication is complete, call the PlayNANOO API with the token received in the SocialSignin method:

New Login (SocialSignIn)

public void SocialSignIn(string token, string accountType)
{
// Facebook 계정으로 처음 로그인
//accountType : PN_ACCOUNT_FACEBOOK
}
References