> For the complete documentation index, see [llms.txt](https://docs.gamepot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gamepot.io/basics/gamepot-3.0/images-and-media/editor/unity-sdk.md).

# Unity SDK

This explains how to use the GAMEPOT Unity SDK for game development in Unity. By installing the SDK and configuring the environment, you can integrate your game with the dashboard.

## Requirements <a href="#undefined" id="undefined"></a>

The following are the requirements for using the GAMEPOT SDK for Unity:

* **Minimum Specification**: Unity 2020.3.0 or later\
  (If you require support for earlier versions of Unity, please contact us at <dl_help_game@navercorp.com>.)

## SDK Installation and Environment Configuration <a href="#sdk" id="sdk"></a>

After installing the GAMEPOT Unity SDK, you can configure the environment to integrate your game with the GAMEPOT dashboard and utilize features essential for game development.

#### The GAMEPOT SDK supports the following languages:

* Korean, English, Italian, Thai, Vietnamese, Japanese, Chinese (Simplified/Traditional), Indonesian, German, Spanish, and French

The SDK displays content in the supported language based on the device's language settings when the app is launched. For unsupported languages, content will be displayed in English.

### SDK Installation <a href="#sdk" id="sdk"></a>

How to Install and Configure the GAMEPOT Unity SDK in Unity

1. Log in to the dashboard with an administrator account.
2. [Download](https://github.com/nbase-io/NBaseSDK-Unity/releases) the latest version from the [official Unity distribution GitHub.](https://github.com/nbase-io/NBaseSDK-Unity)
3. In Unity, navigate to **Assets > Import Package > Custom Package...**, and import the `nbase-unity-plugin-[version].unitypackage` file.
4. From GAMEPOT 3.0 onwards, the SDK is distributed via Maven and CocoaPods, allowing for integration with dozens of external libraries for each platform with simple configuration.

> **COCOAPODS**
>
> For iOS builds, [**CocoaPods**](https://cocoapods.org/) must be installed for proper functionality.

It includes the [External Dependency Manager for Unity](https://github.com/googlesamples/unity-jar-resolver), allowing you to conveniently install Android and iOS packages."

### **Android Gradle** Settings

In Player Settings, make sure to check the boxes for **Custom Main Gradle Template** and **Custom Gradle Properties Template** under Publishing Settings.

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FQNtvHWqAeuUtXi6P6RO8%2Fimage.png?alt=media&amp;token=37734f83-204b-4c59-a1c7-9df3d90c8166" alt=""><figcaption></figcaption></figure>

Please increase the Minimum API Level to 23 (for compatibility with the androidx.security:security-crypto:1.0.0 encryption module).

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FJAQJtR3UvuALMeUKzh7h%2Fimage.png?alt=media&amp;token=7c5199eb-e397-46d6-8506-1ad61d186f62" alt=""><figcaption></figcaption></figure>

Assets > External Dependency Manager > Android Resolver > Settings

* Please uncheck the **Enable Auto-Resolution** and **Explode AARs** options.

<div align="left"><figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FfhRJhWmN9BucmGY7e0k2%2Fimage.png?alt=media&amp;token=7986319e-14fd-471d-9508-9ee591b98290" alt=""><figcaption></figcaption></figure></div>

Please open the file through the editor as shown in the image. You should be able to see a file like the one below.

<div align="left"><figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FjadaPtoENdzS65IZo7ez%2Fimage.png?alt=media&amp;token=b75634d1-aa4d-4525-8e50-3b91988b41e0" alt=""><figcaption></figcaption></figure></div>

The file below defines the dependency packages that are essential for using the NBase SDK. If you wish to use additional features, you can add them to this file, and the modules will be available on both Android and iOS.

**What are Dependency Modules?**\
Dependency modules are used for integrating external SDKs. For example, for Google login, you will need to install the module provided by Google, such as `com.google.android.gms:play-services-auth`.

If updates are available, minor version updates can be applied at any time. However, for major updates, please contact us before using them.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<dependencies>
   <androidPackages>
       <androidPackage spec="io.nbase:nbasesdk:3.0.70"/>
       <androidPackage spec="com.google.code.gson:gson:2.10.1" />
       <androidPackage spec="androidx.security:security-crypto:1.0.0" /> 
       <androidPackage spec="com.apollographql.apollo3:apollo-runtime:4.0.0-beta.4" />
       <androidPackage spec="io.socket:socket.io-client:2.1.0" />
       <androidPackage spec="org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.6" />
   </androidPackages>
   <iosPods>		
       <iosPod name="Alamofire" version="5.8.1" minTargetSdk="9.0" />
       <iosPod name="Socket.IO-Client-Swift" version="16.1.0" minTargetSdk="9.0" />		
       <iosPod name="AppAuth" version="1.6.2" minTargetSdk="9.0" />
       <iosPod name="NBase" version="1.0.13" minTargetSdk="9.0" />
   </iosPods>
</dependencies>
```

For example, when using Google Login and Google Play Store payment.

```xml
<dependencies>
   <androidPackages>
       <androidPackage spec="io.nbase:nbasesdk:3.0.55"/>
       <androidPackage spec="com.google.code.gson:gson:2.10.1" />
       <androidPackage spec="androidx.security:security-crypto:1.0.0" /> 
       <androidPackage spec="com.apollographql.apollo3:apollo-runtime:4.0.0-beta.4" />
       <androidPackage spec="io.socket:socket.io-client:2.1.0" />
       <androidPackage spec="org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.6" />
       <androidPackage spec="io.nbase:nbase-adapter-provider-google:3.0.4"/>
       <androidPackage spec="io.nbase:nbase-adapter-billing-googleplay:3.0.3" />
       <androidPackage spec="com.google.android.gms:play-services-auth:20.7.0" />
       <androidPackage spec="com.android.billingclient:billing:6.1.0" />
   </androidPackages>
   <iosPods>
   	...
   </iosPods>
</dependencies>
```

<table><thead><tr><th width="272">Name</th><th width="101">Version</th><th width="142">Type</th><th>Dependeny modules</th></tr></thead><tbody><tr><td>io.nbase:nbasesdk</td><td>3.0.70</td><td>Gamepot Basic Module</td><td>X</td></tr><tr><td>io.nbase:nbase-adapter-provider-google</td><td>3.0.4</td><td>Google Login</td><td>com.google.android.gms:play-services-auth:20.7.0</td></tr><tr><td>io.nbase:nbase-adapter-provider-apple</td><td>3.0.3</td><td>Apple Login</td><td>X</td></tr><tr><td>io.nbase:nbase-adapter-provider-facebook</td><td>3.0.3</td><td>Facebook Login</td><td>com.facebook.android:facebook-login:latest.release</td></tr><tr><td>io.nbase:nbase-adapter-provider-naver</td><td>3.0.1</td><td>NAVER Login</td><td></td></tr><tr><td>io.nbase:nbase-adapter-provider-line</td><td>3.0.1</td><td>Line Login</td><td></td></tr><tr><td>io.nbase:nbase-adapter-provider-x</td><td>3.0.1</td><td>X Login</td><td></td></tr><tr><td>io.nbase:nbase-adapter-billing-googleplay</td><td>3.0.3</td><td>Google Store</td><td>com.android.billingclient:billing-ktx:6.1.0</td></tr><tr><td>io.nbase:nbase-adapter-billing-one</td><td>3.0.1</td><td>ONEStore</td><td></td></tr><tr><td>io.nbase:nbase-adapter-billing-galaxy</td><td>3.0.1</td><td>Galaxdy Store</td><td></td></tr><tr><td>io.nbase:nbase-adapter-billing-amazon</td><td>3.0.1</td><td>Amazon Store</td><td></td></tr></tbody></table>

Email and guest login are applied to the basic module.

> **Automatic Configuration of NBaseSDKDependencies.xml**
>
> Through the dashboard → Settings → SDK Auto-Generation, a tool is provided to conveniently create tasks like this. You can also request the setup through our customer support center, and we will configure and provide it for you.

Click **Assets > External Dependency Manager > Android Resolver > Force Resolve**.\
After defining in the Dependencies.xml and clicking Force Resolve, the contents defined in the mainTemplate.gradle file will be automatically set as implementation, and this configuration will allow the related libraries to be retrieved during the build process.

### **iOS Settings**

Settings in Tools > GamePotSDK > Edit Settings

<div align="left"><figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FTHBR56tXTsSCWhabSh7w%2Fimage.png?alt=media&amp;token=7d7c529a-5a3b-4550-8acd-55710b917d84" alt=""><figcaption></figcaption></figure></div>

Depending on the social login method, the necessary capabilities for the build, such as push notifications and in-app purchases, are also automatically configured.

Next,\
The XML file should be located under the Editor directory and must match the \*Dependencies.xml format. Open the file at `/Assets/NBaseSDK/Editor/NBaseSDKDependencies.xml`.

You can add the required frameworks between `"iosPods"` and `"/iosPods"`.\
The necessary frameworks are already added by default."

```xml
<?xml version="1.0" encoding="UTF-8"?>
<dependencies>
	<androidPackages>
        ...
	</androidPackages>
    <iosPods>
        <iosPod name="Alamofire" version="5.8.1" minTargetSdk="9.0" />
        <iosPod name="Socket.IO-Client-Swift" version="16.1.0" minTargetSdk="9.0" />		
        <iosPod name="AppAuth" version="1.6.2" minTargetSdk="9.0" />
        <iosPod name="NBase" version="3.0.11" minTargetSdk="9.0" />
    </iosPods>
</dependencies>
```

If you need to install frameworks like Firebase, you can add them separately as shown below.

```xml
<iosPods> 
       ...
        <iosPod name="FirebaseMessaging" version="10.20.0" minTargetSdk="9.0" />
        <iosPod name="Firebase/Analytics" version="10.15.0" minTargetSdk="9.0" />
        ...
</iosPods>
```

Assets -> External Dependency Manager -> iOS Resolver -> Install Cocoapods

> **Please be careful:**
>
> When building a Unity project for iOS, a `Unity-iPhone.xcworkspace` file is created, and you must open this file.
>
> If you open `Unity-iPhone.xcodeproj` instead of `Unity-iPhone.xcworkspace`, the CocoaPods dependencies will not be used. Starting from Unity 2021, this project will be selected automatically.

<table><thead><tr><th width="291">Name</th><th width="99">Version</th><th width="141">Type</th><th>Dependeny modules</th></tr></thead><tbody><tr><td>NBase</td><td>3.0.15</td><td>Gamepot Basic Module듈</td><td>X</td></tr><tr><td>NBaseAdapterProviderGoogle</td><td>3.0.1</td><td>Google Login</td><td></td></tr><tr><td>NBaseAdapterProviderFacebook</td><td>3.0.14</td><td>Facebook Login</td><td>FBSDKLoginKit (16.3.1)</td></tr><tr><td>NBaseAdapterProviderNaver</td><td>3.0.1</td><td>NAVER Login</td><td></td></tr><tr><td>NBaseAdapterProviderLine</td><td>3.0.1</td><td>Line Login</td><td></td></tr><tr><td>NBaseAdapterProviderX</td><td>3.0.1</td><td>X Login</td><td></td></tr><tr><td>NBaseAdapterBillingGoogleplay</td><td>3.0.1</td><td>Google Store</td><td></td></tr><tr><td>NBaseAdapterBillingOne</td><td>3.0.1</td><td>ONEStore</td><td></td></tr><tr><td>NBaseAdapterBillingGalaxy</td><td>3.0.1</td><td>Galaxy Store</td><td></td></tr><tr><td>NBaseAdapterBillingAmazon</td><td>3.0.1</td><td>Amazon Store</td><td></td></tr></tbody></table>

> **Adding the Apollo Package Manager**
>
> If you encounter the error **No such module 'Apollo'**, please run the Swift Package Manager and add the Apollo framework.

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FWrSpYg6oEdh7dvVAChFI%2Fimage.png?alt=media&amp;token=71cc8cef-e8a4-49a2-96db-1233a2f90111" alt=""><figcaption></figcaption></figure>

Click the **'+'** button, then add the package collection with [**https://github.com/apollographql/apollo-ios.git**](https://github.com/apollographql/apollo-ios.git). After that, select **apollo-ios** and choose **Add Package**. Finally, select **Unity-iPhone**.

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FFbfVCAhcBki94Fn9qhcr%2Fimage.png?alt=media&amp;token=2d88b08c-7736-4124-b8ca-094507ce9899" alt=""><figcaption></figcaption></figure>

## Preparation

1. The Project ID and Project Key can be copied from the **Dashboard → Project Settings**.
2. The settings for login, store, and integration can all be added/modified in the **Dashboard → Project Settings**.
3. For each login method, refer to \[[**Login Authentication Settings**](/basics/gamepot-3.0/images-and-media/editor/login-authentication-settings.md)], configure it in the console, and then add it to the dashboard.
4. For in-app purchases, refer to \[[**Store Settings**](/basics/gamepot-3.0/images-and-media/editor/store-settings.md)], configure it in the console, and then add it to the dashboard.
5. For each store where in-app purchases will be made, please register the items. Add them in **Dashboard → Payments → In-App**.

## Initialization <a href="#undefined" id="undefined"></a>

To perform initialization, please add the following code to the object used in the first scene that loads when the game starts.

```csharp
using UnityEngine;
using NBaseSDK;

 public class GamePotExample : MonoBehaviour
 {
     void Start()
     { 
       NBaseSDK.NBase.initialize(projectId, projectKey, [storeId], [language], [region], (init, error) => {
           if (error != null)
           {
               Debug.Log(error.Message);
               return;
           }
           Debug.Log(init.ToString());
       });
     }
 }
```

* Parameter

<table><thead><tr><th width="234">Key</th><th width="322">Description</th><th>Required</th></tr></thead><tbody><tr><td>projectId</td><td>Dashboard → Project Settings</td><td>O</td></tr><tr><td>projectKey</td><td>Dashboard → Project Settings</td><td>O</td></tr><tr><td>storeId</td><td>Refer to the table below</td><td>O</td></tr><tr><td>language</td><td>Language (en,ko,jp...)</td><td>O</td></tr><tr><td>region</td><td>Region (kr, jp, sg, us, eu)</td><td>O</td></tr></tbody></table>

<table><thead><tr><th width="364">Key</th><th>Description</th></tr></thead><tbody><tr><td>Store.google.ToString()</td><td>Google Store</td></tr><tr><td>Store.one.ToString()</td><td>ONEStore</td></tr><tr><td>Store.galaxy.ToString()</td><td>Galaxy Store</td></tr><tr><td>Store.amazon.ToString()</td><td>Amazon Store</td></tr><tr><td>Store.huawei.ToString()</td><td>Huawei Store</td></tr></tbody></table>

* Callback

| Key      | Type   | Description  |
| -------- | ------ | ------------ |
| Status   | bool   | Status       |
| Language | string | Language     |
| Country  | string | Country      |
| RemoteIp | string | IP           |
| Sandbox  | bool   | Sandbox Mode |

#### Initialization (Event Reception)

First, you need to create a script to receive NBase events. This script is called **NBaseListener**, and it can be placed on any object in the scene. It is recommended to call the **DontDestroyOnLoad** method to ensure that this object persists across scenes.

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FmbjuNsnYJHPQvJScV1yZ%2Fimage.png?alt=media&amp;token=ff35fe95-2cc6-4394-8b20-d00becc9847b" alt=""><figcaption></figcaption></figure>

```csharp
using UnityEngine;
using NBaseSDK;
public class NBaseListener: MonoBehaviour, NBaseEventListener
{
	void Start()
	{
        DontDestroyOnLoad(this.gameObject);
        NBaseSDK.NBase.SetEventListener(this);
    }	
}
```

## Login <a href="#undefined" id="undefined"></a>

To use the SDK login functionality that activates when the login button is clicked on the custom login UI implemented by the developer, please use the following code. Before that, ensure that all necessary console and dashboard settings for login are completed for it to function correctly.

```csharp

NBaseSDK.NBase.signIn(Provider.google.ToString(), (user, error) => {
    if (error != null)
    {
        if (error.code == MEMBER_WITHDRAW)
        {
            // Withdraw member
            Debug.Log(error.Message.ToString());    // 탈퇴 메시지
        }
        else if (error.code == APP_UPDATED)
        {
            // Forced Update
            Debug.Log(error.Message.ToString());    // 업데이트 안내 메시지
        }
        else if (error.code == MEMBER_BANNED)
        {
            // Access Block
            Debug.Log(error.Message.ToString());    // 차단 메시지
        }
        else
        {
            Debug.Log(error.Message.ToString());
        }
    else
    {
        // Login Success
        Debug.Log(user.ToString());
    }
    return;
});
```

* Parameter

| Key                           | Description |
| ----------------------------- | ----------- |
| Provider.google.ToString()    | Google      |
| Provider.anonymous.ToString() | Guest       |
| Provider.facebook.ToString()  | Facebook    |
| Provider.apple.ToString()     | Apple       |
| Provider.kakao.ToString()     | Kakao       |
| Provider.playgame.ToString()  | Play Game   |
| Provider.steam.ToString()     | Steam       |
| Provider.x.ToString()         | X           |
| Provider.line.ToString()      | Line        |
| Provider.naver.ToString()     | NAVER       |
| Provider.github.ToString()    | Hithub      |
| Provider.microsoft.ToString() | Microsoft   |
| Provider.huawei.ToString()    | Huawei      |

* Callback

| Key      | Type   | Description        |
| -------- | ------ | ------------------ |
| Id       | string | User Unique ID     |
| Name     | string | User Name          |
| Email    | string | User Email         |
| Token    | string | Token              |
| Age      | int    | User Age           |
| Birth    | string | User Date of Birth |
| Sex      | string | User Gender        |
| Profile  | string | User Profile       |
| Mobile   | string | User Phone Number  |
| Metadata | string | MetaData           |

#### **Auto Login(**&#x4F;ptional)

After initialization, it will attempt to log in automatically using the last authenticated login method.

```csharp
NBaseSDK.NBase.signInLastLoggedIn((user, error) => {
    if (error.code == MEMBER_WITHDRAW)
    {
        // Withdraw member
        Debug.Log(error.Message.ToString());    // 탈퇴 메시지
    }
        else if (error.code == APP_UPDATED)
    {
        // Forced Update
        Debug.Log(error.Message.ToString());    // 업데이트 안내 메시지
    }
    else if (error.code == MEMBER_BANNED)
    {
        // Access Block
        Debug.Log(error.Message.ToString());    // 차단 메시지
    }
    else
    {
        // Login Success
        Debug.Log(user.ToString());
    }
    return;
});
```

#### Custom ID and Password Authentication (Optional)

This authentication method allows users to log in using their email address and password. It performs user authentication based on the user's email address and password, playing a crucial role in traditional email/password-based authentication systems.

```csharp
NBaseSDK.NBase.signInWithPassword(username, password, (user, error) => {
    if (error != null)
    {
        Debug.Log(error.Message.ToString());
        return;
    }
});
```

#### Login with Credentials (Optional)

This is used to handle user login with authentication credentials obtained through various methods (email and password, social media accounts, phone numbers, etc.). It helps easily implement different authentication methods and allows users to log in to Gamepot.

```csharp
NBaseSDK.NBase.signInWithCredential(Provider.gamepot.ToString(), providerToken, (user, error) => {
    if (error != null)
    {
        Debug.Log(error.Message.ToString());
        return;
    }
});
```

## Payment <a href="#undefined" id="undefined"></a>

Before making payments, ensure that the store-specific settings are configured according to the respective store. Additionally, if items are not added in **Dashboard → Payments → In-App**, the error "ProductID not found" will occur.

### **iOS StoreKit Settings**

You need to create a new **StoreKit** file in Xcode.<br>

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FyJl9OwbZjeu5xTGWu8b0%2Fimage.png?alt=media&amp;token=9f2d74b1-a9e9-41c0-87c8-aa810f12bc9a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2Fv4MbgYvVOZaGb7D3PcwC%2Fimage.png?alt=media&amp;token=e5f61e27-e7e4-43fa-8a77-c0e257ac4f3c" alt=""><figcaption></figcaption></figure>

Click the refresh button in front of 'Synced Today,' and the in-app information registered with Apple should be displayed as shown in the image.

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FmwAcFafSE5NFy1Eg7ay6%2Fimage.png?alt=media&amp;token=33c04998-7d2f-4de4-8b34-52b8c4297a90" alt=""><figcaption></figcaption></figure>

### Fetching In-App Information

When making a payment, you need to display the payment information and local currency details on the screen. You can retrieve the current payment currency, name, and other details using the function below. If you are unable to retrieve the information correctly, please check your console settings.

```csharp
NBaseSDK.NBase.getProductItems(Store.google.ToString(), (products, error) => 
{
    if (products != null && products.Count > 0)
    {
        // 제품 목록을 순회합니다.
        foreach (var product in products)
        {
            // 각 제품의 정보를 토스트 메시지로 보여줍니다.
            // 예시에서는 product.ToString()을 호출하고 있지만,
            // 실제로는 product의 구체적인 속성(예: 이름, 가격 등)을 표시할 수 있습니다.
            NBaseSDK.NBase.showToast(product.ToString());
        }
    }
    else
    {
        // 제품 목록이 비어있는 경우, 사용자에게 알립니다.
        NBaseSDK.NBase.showToast("제품 목록이 비어있습니다.");
    }
});
```

* Callback

| Key                        | Type   | Description           |
| -------------------------- | ------ | --------------------- |
| Products\[].Id             | string | Product ID            |
| Products\[].Name           | string | Product Name          |
| Products\[].Price          | double | Product Price         |
| Products\[].Description    | string | Product Description   |
| Products\[].LocalizedPrice | string | Localized Price       |
| Products\[].Currency       | string | Product Currency Unit |

### Payment Request

You can request a payment using the **productId** from the fetched in-app information.

```csharp
NBaseSDK.NBase.purchase(Store.google.ToString(), [productId], [metadata], [options], (purchase, error) => 
{
    if (error != null)
    {
        Debug.Log(error.Message.ToString());
        return;
    }
    // Payment Success
});
```

* Parameter

<table><thead><tr><th width="225">Key</th><th width="327">Description</th><th>Required</th></tr></thead><tbody><tr><td>ProductId</td><td><strong>Product ID</strong> (Dashboard → Payments → In-App Items)</td><td>O</td></tr><tr><td>Metadata</td><td>Metadata</td><td>X</td></tr><tr><td>Options</td><td>Payment Option Features</td><td>X</td></tr></tbody></table>

| Key                     | Description  |
| ----------------------- | ------------ |
| Store.google.ToString() | Google Store |
| Store.one.ToString()    | ONEStore     |
| Store.galaxy.ToString() | Galaxy Store |
| Store.amazon.ToString() | Amazon Store |
| Store.huawei.ToString() | Huawei Store |

* Callback

| Key              | Type   | Description            |
| ---------------- | ------ | ---------------------- |
| storeId          | string | Store Unique ID        |
| paymentId        | string | Payment ID             |
| iapVersion       | string | In-App Billing Version |
| productId        | string | Product ID             |
| billingKey       | string | Billing Key            |
| signature        | string | Signature              |
| originalJson     | string | Original JSON          |
| orderId          | string | Order ID               |
| developerPayload | string | Developer Payload      |
| packageName      | string | Package Name           |
| isAcknowledged   | bool   | Verification Status    |
| purchaseState    | int    | Purchase State         |
| purchaseTime     | long   | Purchase Time          |
| price            | float  | Price                  |
| quantity         | int    | Quantity               |
| currency         | string | Currency Unit          |

## Unity Standalone Guide <a href="#unity-standalone" id="unity-standalone"></a>

Standalone refers to builds for Mac, Windows, and Linux. The Gamepot SDK supports cross-platform development, but the features supported on mobile and Standalone platforms differ. Please refer to the table below to plan your development accordingly.

<table><thead><tr><th width="208">Service</th><th width="101">Android</th><th width="85">iOS</th><th width="74">Web</th><th>PC</th></tr></thead><tbody><tr><td>Login</td><td>O</td><td>O</td><td>O</td><td>PC Login and Token Verification</td></tr><tr><td>Payment</td><td>O</td><td>O</td><td>O</td><td>Move to PC Payment</td></tr><tr><td>Notice</td><td>O</td><td>O</td><td>O</td><td>O</td></tr><tr><td>Customer Support</td><td>O</td><td>O</td><td>O</td><td>O</td></tr><tr><td>Leaderboard</td><td>O</td><td>O</td><td>O</td><td>O</td></tr><tr><td>Friend Management</td><td>O</td><td>O</td><td>O</td><td>O</td></tr><tr><td>Push</td><td>O</td><td>O</td><td>X</td><td>X</td></tr><tr><td>Maintenance</td><td>O</td><td>O</td><td>O</td><td>O</td></tr><tr><td>Update</td><td>O</td><td>O</td><td>O</td><td>O</td></tr><tr><td>Coupons</td><td>O</td><td>O</td><td>O</td><td>O</td></tr><tr><td>Chat</td><td>O</td><td>O</td><td>O</td><td>O</td></tr><tr><td>Data Storage</td><td>O</td><td>O</td><td>O</td><td>Coming Soon</td></tr><tr><td>Security</td><td>O</td><td>O</td><td>X</td><td>Coming Soon</td></tr><tr><td>Player</td><td>O</td><td>O</td><td>O</td><td>Coming Soon</td></tr></tbody></table>

> **Web 3.0 Guide**
>
> The Web version is a feature available only for the GamePot 3.0 TypeScript version.

#### **Newtonsoft.Json** Conflict

The NBase Unity SDK uses Unity's Newtonsoft Json package for API request parsing. Since Json is one of the most commonly used libraries, there is a possibility of encountering library duplication errors if a Json library is already present in the project.

In this case, you can either delete the Newtonsoft.Json file in the Plugins/Standalone directory or remove the existing Json library from the project and use Unity's built-in Json package. Unity's Json package has been modified to work with the Unity engine and is a version that fully supports IL2CPP.

## Troubleshooting

**Q. UnityPlayerActivity.java uses or overrides a deprecated API.**&#x20;

A. Go to **Edit → Project Settings → Player → Publishing Settings** and check the **Custom Properties Gradle Template** option..

**Q. error:1E08010C:DECODER routines::unsupported**

A. If there is a mismatch in the Google Authentication Key value, refer to the Google Play Store guide and ensure the key is entered correctly.

**Q.** When trying to download from official Maven repositories like **OneStore** or **Gamepot Beta**, or from **maven** or **jitpack.io**, Unity shows an error.

```
Could not determine the dependencies of task ':unityLibrary:compileReleaseAidl'.
> Could not resolve all task dependencies for configuration ':unityLibrary:releaseCompileClasspath'.
   > Could not find io.nbase:nbasesdk:0.0.71-beta.
     Required by:
         project :unityLibrary
```

For modules that do not use public Maven, you need to specify the Maven repository address as follows:

You can add the Maven repository address in the NBaseSDKDependencies file when configuring it.

```xml
# ONEstore
<androidPackage spec="com.onestorecorp.sdk:sdk-iap:21.01.00"/>
    <repositories>
        <repository>https://repo.onestore.co.kr/repository/onestore-sdk-public</repository>
    </repositories>
</androidPackage>

# NBase Beta maven Repository
<androidPackage spec="io.nbase:nbasesdk:3.0.39-beta.1"/>
    <repositories>
        <repository>https://repo.nbase.io/repository/nbase-releases/</repository>
    </repositories>
</androidPackage>
```

You can also add the address for **jitpack.io** as shown above.

**Q.** Minimum API Level Upgrade Notice

A. Please upgrade the API Level from the default **22** to **24**.

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FeYWyNEtFu0qcwUaiEENE%2Fimage.png?alt=media&amp;token=1ee3e053-4ebf-40f9-b28f-d73f4787bc74" alt=""><figcaption></figcaption></figure>

**Q. Authorization failed: Error Domain=AKAuthenticationError Code=-7026**

A. Click **TARGETS > +Capability** and add **Sign in with Apple**.

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FwU7atTSlacaMi5JBV4kj%2Fimage.png?alt=media&amp;token=d5ff4913-01da-4ec7-83ef-9f2ff857471c" alt=""><figcaption></figcaption></figure>

**Q. Couldn't get credential from result.10: Developer console is not set up correctly**

**A.** This error may occur if the client ID for the web application type is not set in **Google Cloud Console > Credentials > OAuth 2.0 Client ID**.\
\
**Q. 16: Cannot find a matching credential.**

**A.** This error may occur if the **OAuth 2.0 Client ID** is not registered in **Google Cloud Console > Credentials**.\
\
**Q. java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/billingclient/api/BillingClient;**

**A.** Please add the following code.

```
<androidPackage spec="com.android.billingclient:billing:6.1.0" /> 
```

**Q.** (iOS) A crash occurs when the app is launched, and the error "/AdapterProviderFacebook' (no such file)" is found.

**A.** Add **AdapterProviderFacebook.xcframework** in **Xcode TARGETS → General → Frameworks, Libraries, and Embedded Content**.

**Q.** If you encounter the error `'/usr/lib/swift/NBase.framework/NBase' (no such file, not in dyld cache)` after running the app, please add **NBase.xcframework** as follows.

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2F20D6Ot6zYiuDqMwXIjil%2Fimage.png?alt=media&amp;token=2fad45db-7650-4201-a9d0-5203b1e2cd4d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FSt1DdFzT5MOc8ehrI17q%2Fimage.png?alt=media&amp;token=83d101f6-142a-496d-b601-e73c9607d26e" alt=""><figcaption></figcaption></figure>

**Q. (iOS) The error "NSBundle file:///System/Library/Frameworks/Metal.framework/ principal class is nil because all fallbacks have failed" occurs in the iOS 18 environment.**

**A. Open the Edit Scheme window (shortcut: CMD + SHIFT + ,) and uncheck the 'API Validation' option under the Metal section, as shown below.**

<figure><img src="https://595161671-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL6LhVnp8tbUGljJE5BFj%2Fuploads%2FqHGUQsRqHQxi7HdfU4Hx%2Fimage.png?alt=media&amp;token=bb2680bd-5479-415e-95a0-5ef55b24e0c5" alt=""><figcaption></figcaption></figure>
