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
| Parameter | Type | Required | Description |
|---|---|---|---|
| account_token | string | Required | Social login token (Facebook Access Token) |
| account_type | string | Required | Account 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
| 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 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.
2. Link Account with Token
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
- Account Type Value:
PN_ACCOUNT_FACEBOOK = "FACEBOOK"- For detailed information, see Etc > Account Type Information - Member Conversion: See Guest Login > Member Conversion documentation