Unity SDK

Prev Next

Available in Classic and VPC

This guide provides instructions on how to use the GAMEPOT Unity SDK in the Unity environment. You can integrate the game and dashboard by installing the SDK and configuring the environment.

Requirements

The recommended specifications required to use GAMEPOT SDK for Unity are as follows:

  • Unity minimum version: 2022.3.44f1 or later
  • If you need support for older versions of Unity, contact us through Contact us.

Install SDK and configure environment

You can install the GAMEPOT Unity SDK, configure the environment, and integrate the game and GAMEPOT dashboard to use features required for the game development.

The GAMEPOT SDK supports the following languages.

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

When you reset GAMEPOT, the interface will automatically display in the language you selected during registration. Languages not supported will be displayed in English.

SDK installation

To install the GAMEPOT Unity SDK and configure your project in Unity, follow these steps.

  1. Download the latest version from the Official Unity GitHub repository.
  2. In Unity, go to Assets > Import Package > Custom Package..., then select and import the nbasesdk-unity-plugin-[version].unitypackage file.
    • Starting with GAMEPOT 3.0, it is distributed via Maven distribution and CocoaPods, and integrates with dozens of external libraries with simple setup per device.
Note

For iOS builds, CocoaPods must be installed to work properly.

It is installed including External Dependency Manager for Unity, which enables you to install Android and iOS packages conveniently.

In NBase SDK Unity 3.0.18 or later, you can select the modules to use for Android and iOS from the Tools > GamePotSDK > Dependency Manager menu. Clicking Apply Dependencies updates Assets/NBaseSDK/Editor/NBaseSDKDependencies.xml and runs the Android dependency resolution. Use Advanced Mode only if you need to specify versions manually.

Set Gradle for Android

Follow the Gradle setup procedure required for Android builds in order.

  1. In Player Settings, under Publishing Settings, select Custom Main Gradle Template and Custom Gradle Properties Template.
    gamepot-UnitySDK01.png
  2. Raise the minimum API level to 24.
    gamepot-UnitySDK02.png
  3. Click the Assets > External Dependency Manager > Android Resolver > Settings menus, in that order, and then deselect the Enable Auto-Resolution and Explode AARs fields.
    gamepot-UnitySDK03.png
  4. Open Tools > GamePotSDK > Dependency Manager, select the Android module to use, and click Apply Dependencies.

If you need to add modules not provided by the Dependency Manager, you can edit Assets/NBaseSDK/Editor/NBaseSDKDependencies.xml directly. The following is an example that defines the dependency packages required by default for using the NBase SDK.

What are dependency modules?
Dependency modules are modules for using external SDKs, such as io.nbase:nbase-adapter-provider-google for Google login, which must be installed with the module provided by Google.

XML example:

<?xml version="1.0" encoding="UTF-8"?>
<dependencies>
    <androidPackages>
        <androidPackage spec="io.nbase:nbasesdk:3.0.98"/>
    </androidPackages>
    <iosPods>
        <iosPod name="NBase" version="3.0.67" minTargetSdk="15.1" />
    </iosPods>
</dependencies>
  • When using Google login and Google Play Store payment

XML example:

<dependencies>
    <androidPackages>
        <androidPackage spec="io.nbase:nbasesdk:3.0.98"/>
        <androidPackage spec="io.nbase:nbase-adapter-provider-google:3.0.13"/>
        <androidPackage spec="io.nbase:nbase-adapter-billing-googleplay:3.0.12" />
    </androidPackages>
    <iosPods>
        <iosPod name="NBase" version="3.0.67" minTargetSdk="15.1" />
        <iosPod name="NBaseAdapterProviderGoogle" version="3.0.58" minTargetSdk="15.1" />
    </iosPods>
</dependencies>

Supported AOS-dependent modules are as follows:

Name Description Dependency modules
io.nbase:nbasesdk GAMEPOT base module X
io.nbase:nbase-adapter-provider-google Google login X
io.nbase:nbase-adapter-provider-apple Apple login X
io.nbase:nbase-adapter-provider-facebook Facebook login com.facebook.android:facebook-login:latest.release
io.nbase:nbase-adapter-provider-kakao Kakao login X
io.nbase:nbase-adapter-provider-line LINE login X
io.nbase:nbase-adapter-provider-naver NAVER login X
io.nbase:nbase-adapter-provider-huawei Huawei login X
io.nbase:nbase-adapter-provider-playgame Google Play Games login X
io.nbase:nbase-adapter-provider-x X login X
io.nbase:nbase-adapter-billing-googleplay Google Play Store com.android.billingclient:billing:8.0.0
io.nbase:nbase-adapter-billing-onestore ONE Store X
io.nbase:nbase-adapter-billing-galaxy Galaxy Store X
io.nbase:nbase-adapter-billing-huawei Huawei Store X

Email and guest logins are applied to the base module.

If the Dependency Manager is unable to automatically resolve Android dependencies, click Assets > External Dependency Manager > Android Resolver > Force Resolve in the Unity Editor.

After defining in Dependencies.xml, if you run Force Resolve, the content defined in the mainTemplate.gradle file is automatically defined as implementation, and this content must be completed to import the relevant libraries when building.

Set iOS

Open Tools > GamePotSDK > Dependency Manager, select the iOS module to use, and click Apply Dependencies.

If you need to add a pod that is not provided by the Dependency Manager, you can directly edit the iosPods section in the Assets/NBaseSDK/Editor/NBaseSDKDependencies.xml file.

XML example:

<?xml version="1.0" encoding="UTF-8"?>
<dependencies>
	<androidPackages>
        ...
	</androidPackages>
    <iosPods>
		<iosPod name="NBase" version="3.0.67" minTargetSdk="15.1" />
    </iosPods>
</dependencies>

If you want to install the necessary framework, such as Firebase, you can do so separately as shown below.

XML example:

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

If CocoaPods is not installed,
Click Assets > External Dependency Manager > iOS Resolver > Install Cocoapods within the Unity Editor.

Caution

When you build a Unity project for iOS, the Unity-iPhone.xcworkspace file is created, which you need to open.
If you don't open the Unity-iPhone.xcworkspace file instead of Unity-iPhone.xcodeproj, the CocoaPods dependency will not be used.
Starting with Unity 2021, the project will be selected automatically.

Supported iOS dependent modules are as follows:

Name Description Dependency modules
NBase GAMEPOT base module X
NBaseAdapterProviderGoogle Google login X
NBaseAdapterProviderFacebook Facebook login FBSDKLoginKit (17.4.0)
NBaseAdapterProviderGameCenter Game Center login X
NBaseAdapterProviderNaver NAVER login X
NBaseAdapterProviderLine LINE login X
NBaseAdapterProviderKakao Kakao login X
NBaseAdapterProviderX X login X
Caution

Some dependent frameworks can only be added through the Swift Package Manager.

The following describes how to manually add essential dependency frameworks that require installation via Swift Package Manager.

  1. In Xcode, go to Project Settings, and then enter the Package Dependencies settings.
    gamepot-UnitySDK05.png

  2. Add https://github.com/apollographql/apollo-ios.git to the URL input field at the top right, search for it, select apollo-ios, and then add it with Add Package.

  3. Add the Apollo and ApolloAPI modules displayed in the modal to the main target (Unity-iPhone) of your project.
    gamepot-UnitySDK06.png

    The following table, this section, describes the dependency modules added via Swift Package Manager.

    Name Dependency modules Location Version Framework
    NBase Apollo https://github.com/apollographql/apollo-ios.git 1.15.2 Apollo, ApolloAPI

Preparation

Before applying the GAMEPOT Unity SDK, verify the following essential configuration items.

  1. Copy the project ID and project key from Dashboard > Project settings.
  2. Add/edit login, store, and integration settings in Dashboard > Project settings.
  3. See Configuration by login method for each login, set it in the console and add it to the dashboard.
  4. Before in-app payment, see Configuration by store to set it in the console and add it to the dashboard.
  5. Before in-app payment, register items in Dashboard > Payment > In-app for each payment store.

Reset

To perform an initialization, add the following code to the object used in the first scene loaded when the game starts.

C# Example:

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());
       });
     }
 }
  • Parameters

The following table describes the parameters required for initialization.

Key Type Description Required
projectId String Project ID found in Dashboard → Project settings O
projectKey String Project key found in Dashboard → Project settings O
storeId String Store identifier in the table below O
language String Language codes (en, ko, ja, etc.) O
region String Region code (kr, jp, sg, us, eu) O

See the following table for store identifiers.

Key Description
Store.google.ToString() Google Play Store
Store.one.ToString() ONE Store
Store.galaxy.ToString() Galaxy Store
Store.amazon.ToString() Amazon Store
Store.huawei.ToString() Huawei Store
Store.pc.ToString() PC store
Store.steam.ToString() Steam store
  • Callback

The following table describes the information passed to the initialization callback.

Key Type Description
Status bool Condition
Language string Language
Country string Country
RemoteIp string IP
Platform string Platform
Sandbox bool Sandbox status

Reset (event receipt)

First, you need to create a script that receives NBase events.
This script is called NBaseListener and can be placed on any object in the scene. It is recommended that you call the DontDestroyOnLoad method to ensure that the object exists permanently.

The image below illustrates an example of configuring the NBaseListener script in a scene.
gamepot-UnitySDK09.png

C# Example:

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

Login feature

This section describes how to authenticate users using various authentication methods through the login feature.

Use login feature

Use the following code to use the SDK login feature that functions when clicking the login button according to the login UI implemented by the developer. Before that, you must complete all the console and dashboard settings required for login to work properly.

C# Example:

NBaseSDK.NBase.signIn(Provider.google.ToString(), (user, error) => {
    if (error != null)
    {
        if (error.Code == NBaseSDK.NBase.ErrorCode.MEMBER_WITHDRAW) // Withdrawal status
        {
            // Withdrawal
            Debug.Log(error.Message.ToString());    // Withdrawal message
        }
        else if (error.Code == NBaseSDK.NBase.ErrorCode.SERVICE_MAINTENANCE) // Maintenance
        {
            Debug.Log(error.Message.ToString());    // Maintenance message
            // case 1: Use in-game popup implemented directly by the developer
            // case 2: Call the code below to use the SDK's own popup
            // NBaseSDK.NBase.showAppStatusPopup(user?.AppStatus, (status, error) => {
            //     // Popup handling
            // });
        }
        else if (error.Code == NBaseSDK.NBase.ErrorCode.UPDATE_REQUIRED) // Update
        {
            Debug.Log(error.Message.ToString());    // Update message
            // case 1: Use in-game popup implemented directly by the developer
            // case 2: Call the code below to use the SDK's own popup
            // NBaseSDK.NBase.showAppStatusPopup(user?.AppStatus, (status, error) => {
            //     // Popup handling
            // });
        }
        else if (error.Code == NBaseSDK.NBase.ErrorCode.MEMBER_BANNED) // Access blocked
        {
            Debug.Log(error.Message.ToString());    // Block message
        }
        else 
        {
            // signIn Failed
            Debug.Log(error.Message.ToString());
        }
    }
    else
    {
        // signIn Success
        Debug.Log(user.ToString());
    }
    return;
});

If you use the pop-up provided by the SDK when updating or checking, add the following code.

C# Example:

NBaseSDK.NBase.showAppStatusPopup(appStatus, (status, error) =>
{
    bool shouldClose = false;
    bool shouldNext = false;
    var closeValue = status.Close; 
    var nextValue = status.Next;

    if (closeValue != null)
    {
        if (bool.TryParse(closeValue.ToString(), out bool result))
        {
            shouldClose = result;
        }
    }

    if (shouldClose)
    {
        // App Close
    }

    if (nextValue != null)
    {
        if (bool.TryParse(nextValue.ToString(), out bool result))
        {
            shouldNext = result;
        }
    }

    if (shouldNext)
    {
        // Next, Optional update
    }
});
  • Provider

The following table describes the service types used in the login feature.

Key Description
Provider.google.ToString() Google
Provider.anonymous.ToString() Guest
Provider.facebook.ToString() Facebook
Provider.apple.ToString() Apple
Provider.kakao.ToString() Kakao
Provider.googleplay.ToString() Play Games
Provider.steam.ToString() Steam
Provider.x.ToString() X
Provider.line.ToString() LINE
Provider.naver.ToString() NAVER
Provider.github.ToString() GitHub
Provider.microsoft.ToString() Microsoft
Provider.huawei.ToString() Huawei
  • User

The following table describes the fields of the User object.

Key Type Description
Id string User's unique ID
SocialId string Social ID
Name string Name (if provided)
Email string Email (if provided)
Token string Token
Age int Age (if provided)
Profile string Profile (if provided)
CustomField string Custom field
IsSignUp bool Registration status
AppStatus AppStatus Maintenance/update status

AppStatus

The following table describes the fields of the AppStatus object.

Key Type Description
Message string Message
StartedAt long Start Time
EndedAt long End time
CurrentAppVersion string Current app version
UpdateAppVersion string Update app version
CurrentAppVersionCode string Current app version code
UpdateAppVersionCode string Update app version code
IsForce bool Whether to force update
Url string URL registered for maintenance/update

Login UI provided by SDK

You can use the login UI provided by GAMEPOT SDK in a completed form.
Use the following code to call the login UI provided by the SDK.

C# Example:

NBaseSDK.NBase.openSignInUI((user, error) => {
    if (error != null)
    {
        if (error.Code == NBaseSDK.NBase.ErrorCode.MEMBER_WITHDRAW) // Withdrawal status
        {
            // Withdrawal
            Debug.Log(error.Message.ToString());    // Withdrawal message
        }
        else if (error.Code == NBaseSDK.NBase.ErrorCode.SERVICE_MAINTENANCE) // Maintenance
        {
            Debug.Log(error.Message.ToString());    // Maintenance message
            // case 1: Use in-game popup implemented directly by the developer
            // case 2: Call the code below to use the SDK's own popup
            // NBaseSDK.NBase.showAppStatusPopup(user?.AppStatus, (status, error) => {
            //     // Popup handling
            // });
        }
        else if (error.Code == NBaseSDK.NBase.ErrorCode.UPDATE_REQUIRED) // Update
        {
            Debug.Log(error.Message.ToString());    // Update message
            // case 1: Use in-game popup implemented directly by the developer
            // case 2: Call the code below to use the SDK's own popup
            // NBaseSDK.NBase.showAppStatusPopup(user?.AppStatus, (status, error) => {
            //     // Popup handling
            // });
        }
        else if (error.Code == NBaseSDK.NBase.ErrorCode.MEMBER_BANNED) // Access blocked
        {
            Debug.Log(error.Message.ToString());    // Block message
        }
        else 
        {
            // signIn Failed
            Debug.Log(error.Message.ToString());
        }
    }
    else
    {
        // signIn Success
        Debug.Log(user.ToString());
    }
    return;
});

Auto login (optional)

After initialization, it may attempt to automatically log in with the last authentication method you logged in with. We recommend checking the last login provider type before attempting automatic login.

C# Example:

// Check the last login provider type.
string lastProviderType = NBaseSDK.NBase.getLastProviderType();

if (lastProviderType != Provider.none.ToString())
{
    // Attempt automatic login only if last login information is available.
    NBaseSDK.NBase.signInLastLoggedIn((user, error) => {
        if (error != null)
        {
            if (error.Code == NBaseSDK.NBase.ErrorCode.MEMBER_WITHDRAW) // Withdrawal status
            {
                // Withdrawal
                Debug.Log(error.Message.ToString());    // Withdrawal message
            }
            else if (error.Code == NBaseSDK.NBase.ErrorCode.SERVICE_MAINTENANCE) // Maintenance
            {
                // Maintenance
                Debug.Log(error.Message.ToString());    // Maintenance message
                /* case 1: Use in-game popup implemented directly by the developer
                case 2: Call the code below to use the SDK's own popup
                NBaseSDK.NBase.showAppStatusPopup(user?.AppStatus, (status, error) => {
                    // Popup handling
                });
                */
            }
            else if (error.Code == NBaseSDK.NBase.ErrorCode.UPDATE_REQUIRED) // Update
            {
                // Update
                Debug.Log(error.Message.ToString());    // Update message
                /* case 1: Use in-game popup implemented directly by the developer
                case 2: Call the code below to use the SDK's own popup
                NBaseSDK.NBase.showAppStatusPopup(user?.AppStatus, (status, error) => {
                    // Popup handling
                });
                */
            }
            else if (error.Code == NBaseSDK.NBase.ErrorCode.MEMBER_BANNED) // Access blocked
            {
                // Access blocked
                Debug.Log(error.Message.ToString());    // Block message
            }
            else
            {
                // signIn Failed
                Debug.Log(error.Message.ToString());
            }
        }
        else
        {
            // signIn Success
            Debug.Log(user.ToString());
        }
    });
}
else
{
    // No last login information
    Debug.Log("No last login provider found");
}

The getLastProviderType() method returns the last logged-in provider type.

The signInLastLoggedIn() method attempts automatic login using the last authentication method used to log in.

  • Callback

The following table describes the values passed to the automatic login callback.

Key Type Description
user User User information upon successful login
error Error Error information upon login failure

Log out

Use the following code to log out of your GAMEPOT account.

C# Example:

NBaseSDK.NBase.signOut((status, error) => {
    if (error != null)
    {
        // signOut Failed
        Debug.Log("signOut Failed: " + error.Message.ToString());
    }
    else
    {
        // signOut Success
        Debug.Log("signOut Success: " + status.ToString());
        // Processing logic after successful logout
    }
});
  • Callback

The following table describes the values passed to the logout callback.

Key Type Description
status Boolean Success or Failure
error Error Error information when logout fails

Membership withdrawal

Use the following code to use the SDK membership withdrawal feature.

C# Example:

NBaseSDK.NBase.deleteMember(providerId, (status, error) => {
    if (error != null)
    {
        // deleteMember Failed
        Debug.Log("deleteMember Failed: " + error.Message.ToString());
    }
    else
    {
        // deleteMember Success
        Debug.Log("deleteMember Success: " + status.ToString());
        // Logic after successful membership withdrawal
    }
});
  • Parameters

The following table, this section, describes the parameters that must be passed for a membership withdrawal.

Key Type Description Required
providerId String Logged-in provider type (example: Provider.google.ToString(), Provider.anonymous.ToString(), etc.) O
  • Callback

The following table describes the callback values for membership withdrawal.

Key Type Description
status Boolean Success or Failure
error Error Error information when membership withdrawal fails

Self-authentication with username and password (optional)

This is an authentication method that allows users to log in using their email address and password. It performs user authentication based on the user's email address and password.

C# Example:

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

Log in with credentials (optional)

Use the following code to log in using credentials (access tokens) obtained from external social accounts.

C# Example:

NBaseSDK.NBase.signInWithCredential(Provider.google.ToString(), providerToken, (user, error) => {
    if (error != null)
    {
        if (error.Code == NBaseSDK.NBase.ErrorCode.SERVICE_MAINTENANCE) // Maintenance
        {
            // Maintenance
            Debug.Log("Maintenance: " + error.Message.ToString());
            /* case 1: Use in-game popup implemented directly by the developer
            case 2: Call the code below to use the SDK's own popup
            NBaseSDK.NBase.showAppStatusPopup(user?.AppStatus, (status, error) => {
                // Popup handling
            });
            */
        }
        else if (error.Code == NBaseSDK.NBase.ErrorCode.UPDATE_REQUIRED) // Update
        {
            // Update
            Debug.Log("Update: " + error.Message.ToString());
            /* case 1: Use in-game popup implemented directly by the developer
            case 2: Call the code below to use the SDK's own popup
            NBaseSDK.NBase.showAppStatusPopup(user?.AppStatus, (status, error) => {
                // Popup handling
            });
            */
        }
        else
        {
            // signInWithCredential Failed
            Debug.Log("signInWithCredential Failed: " + error.Message.ToString());
        }
    }
    else
    {
        // signInWithCredential Success
        Debug.Log("signInWithCredential Success: " + user.ToString());
    }
});
  • Parameter

The following table describes the parameters required for credential login.

Key Type Description Required
provider String Provider ID (example: Provider.google.ToString(), Provider.facebook.ToString(), etc.) O
providerToken String Access token of the social account O
  • Callback

The following table describes the credential login callback values.

Key Type Description
user User User information upon successful login
error Error Error information upon login failure

External account integration feature

This section describes the feature that allows you to integrate and manage external social accounts with your GAMEPOT user account.

Note

The external account integration feature in Unity Standalone is available in NBase SDK Unity 3.0.18 or later.

  • Supported platform: Windows, macOS, Linux Standalone
  • Supported provider: Steam
  • Supported API: createLinking, getLinkedLists, deleteLinking
  • Unsupported API: updateLinking

To call createLinking in Standalone, Steamworks.NET must be installed and the STEAMWORKS_NET scripting symbol must be enabled. Your game must initialize the Steam API and continue to call SteamAPI.RunCallbacks(). The NBase SDK does not directly initialize or terminate the Steam API.

Use external account integration feature

Use the following code to integrate another social account with your current GAMEPOT user account.

C# Example:

NBaseSDK.NBase.createLinking(Provider.google.ToString(), (linkingId, error) => {
    if (error != null)
    {
        // createLinking Failed
        Debug.Log("createLinking Failed: " + error.Message.ToString());
    }
    else
    {
        // createLinking Success
        Debug.Log("createLinking Success: " + linkingId);
        // Processing logic after successful account integration
    }
});
  • Parameter

The following table describes the parameters required for account integration.

Key Type Description Required
providerId String Provider type to integrate (example: Provider.google.ToString(), Provider.facebook.ToString(), etc.) O
  • Callback

The following table describes the callback values for account integration.

Key Type Description
linkingId String Integration ID returned when integration is successful
error Error Error information on integration failure

Integrate Steam account on Unity Standalone

To integrate your current Steam client account with your logged-in GAMEPOT user account, configure and call the following steps.

  1. Install Steamworks.NET in your Unity project.
  2. Register the Steamworks app ID and web API key in the Steam integration settings on the GAMEPOT dashboard.
  3. For local testing, enter your Steamworks app ID in steam_appid.txt. If you are running the built executable directly outside of Steam, place this file in the same folder as the executable. Do not include the test steam_appid.txt file in your release build.
  4. Initialize the Steam API while logged into the Steam client.
  5. Complete the GAMEPOT login, then call createLinking using Provider.steam.

C# Example:

NBaseSDK.NBase.createLinking(Provider.steam.ToString(), (linkingId, error) => {
    if (error != null)
    {
        Debug.LogError($"Steam account linking failed: {error.Code} / {error.Message}");
        return;
    }

    Debug.Log($"Steam account linking succeeded: {linkingId}");
});

The createLinking method in Standalone currently supports only the Steam provider. If you pass a provider such as Google or Apple, an error callback will be returned. If Steamworks.NET is not installed, the Steam API has not been initialized, the Steam client is not logged in, or the authentication ticket issuance fails, the operation will not be treated as successful and will return an error.

After successful integration, you can save the returned linkingId or retrieve it again using getLinkedLists. To unintegrate, you must pass this linking ID rather than the provider string.

Check integration list

Use the following code to check the list of social accounts currently integrated with your GAMEPOT user account. The same API is used in Unity Standalone as well.

C# Example:

NBaseSDK.NBase.getLinkedLists((linkings, error) => {
    if (error != null)
    {
        // getLinkedLists Failed
        Debug.Log("getLinkedLists Failed: " + error.Message.ToString());
    }
    else
    {
        // getLinkedLists Success
        if (linkings == null || linkings.Count == 0)
        {
            Debug.Log("No linked accounts");
            return;
        }

        foreach (NBaseSDK.NBase.Linking linking in linkings)
        {
            Debug.Log($"getLinkedLists Success: {linking.Provider} / {linking.Id}");
        }
    }
});
  • Callback

The following table describes the values provided when checking the account integration list.

Key Type Description
linkings List List of integrated accounts
error Error Error message when list retrieval fails
  • Linking

The following table describes the fields of the Linking object.

Key Type Description
Id String Integration ID (use when removing account integration)
Username String Social ID
Provider String Social provider type

Remove integration

To remove a specific social account integration from your current GAMEPOT user account, use the following code. Unity Standalone uses the same API, and you need to pass the Linking.Id found in getLinkedLists.

C# Example:

NBaseSDK.NBase.deleteLinking(linkingId, (status, error) => {
    if (error != null)
    {
        // deleteLinking Failed
        Debug.Log("deleteLinking Failed: " + error.Message.ToString());
    }
    else if (status)
    {
        // deleteLinking Success
        Debug.Log("deleteLinking Success: " + status.ToString());
        // Processing logic after successful integration removal
    }
    else
    {
        Debug.LogWarning("deleteLinking returned false");
    }
});
  • Parameter

The following table describes the parameters required for account integration removal.

Key Type Description Required
linkingId String Integration ID to remove (obtained from createLinking or getLinkedLists) O
  • Callback

The following table describes the callback values for account integration removal.

Key Type Description
status Boolean Success or Failure
error Error Error information when integration removal fails

Check app status

Use the following code to check the client's current maintenance/update status.

C# Example:

NBaseSDK.NBase.checkAppStatus((status, error) =>
{
    if (error != null)
    {
        Debug.LogError("checkAppStatus Failed: " + error.Message);
        return;
    }

    switch(status.State)
    {
        case NBaseSDK.NBase.AppStatus.Status.SUCCESS:
            // SUCCESS
            break;
        case NBaseSDK.NBase.AppStatus.Status.FAILED:
            // FAILED
            break;
        case NBaseSDK.NBase.AppStatus.Status.MAINTENANCE:
            // Maintenance
            /* case 1: Use in-game popup implemented directly by the developer
            case 2: Call the code below to use the SDK's own popup
            NBaseSDK.NBase.showAppStatusPopup(status, (popupStatus, popupError) => {
                // Popup handling
            });
            */
            break;
        case NBaseSDK.NBase.AppStatus.Status.UPDATE:
            // Update
            /* case 1: Use in-game popup implemented directly by the developer
            case 2: Call the code below to use the SDK's own popup
            NBaseSDK.NBase.showAppStatusPopup(status, (popupStatus, popupError) => {
                // Popup handling
            });
            */
            break;
    }
});

Unity Standalone information

Standalone refers to builds for Mac, Windows, and Linux.
The GAMEPOT SDK supports cross-platform, but the features supported by mobile and Standalone are different, so see the table below to plan your development.

Service Android iOS Web PC Remarks
Login O O O Validate token after PC login.
Payment O O O Go to the PC payment page.
Notice O O O O Provide list query excluding the UI.
Support O O O O Go to PC.
Leaderboard O O O O
Friend management O O O O
Push O O X X
Maintenance check O O O O
Update O O O O
Coupons O O O O
Chat O O O O
Data storage O O O O
Security O O X Under preparation
Player O O O O
Integrate external account O O X O For PCs, only Steam is supported (NBase SDK Unity 3.0.18 or later).
Note

The web version is a feature only available in the GamePot 3.0 Typescript version.

Newtonsoft.Json crash

The NBase Unity SDK uses Unity's Newtonsoft JSON package to parse API requests. JSON is one of the most commonly used libraries, so there is a possibility that you already have JSON in your project and you will get the following library duplication error.

In this case, you can delete the Newtonsoft.Json file in the Plugins/Standalone path or delete the JSON library already in the project and use Unity's JSON. Unity's JSON package has been modified to work with the Unity engine and is a fully supported version of IL2CPP.

Troubleshooting

This section provides information on common errors and how to resolve them.

Q. UnityPlayerActivity.java uses or overrides a deprecated API.
A. Select Edit > Project Settings > Player > Publishing Settings > Custom Properties Gradle Template.

Q. error:1E08010C:DECODER routines::unsupported
A. This occurs when the Google authentication key value does not match. See the Google Play Store guide and enter the key correctly.

Q. Minimum API level increase notice
A. Raise the minimum API level from 22 to 24.
The image below illustrates where to adjust the API level.
gamepot-UnitySDK13.png

Q. Authorization failed: Error Domain=AKAuthenticationError Code=-7026
A. Add Sign In with Apple by clicking TARGETS > +Capability.
The image below illustrates the page for adding the Sign in with Apple feature.
gamepot-UnitySDK14.png

Q. Couldn't get credential from result.10: Developer console is not set up correctly
A. This error may occur because the client ID of the web application type is not set in Google Cloud Console > Set credentials > OAuth 2.0 client ID.

Q. 16: Cannot find a matching credential.
A. This error can occur when the Google Cloud Console > Set credentials > OAuth 2.0 client ID is not registered.

Q. java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/billingclient/api/BillingClient;
A. Add the following code.

XML example:

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

Q. (iOS) A crash occurs when the app is launched, and the "/AdapterProviderFacebook' (no such file)" error is confirmed.
A. Add Xcode TARGETS → General → Frameworks, Libraries, and Embedded Content → AdapterProviderFacebook.xcframework.

Q. (iOS) After launching, an "'/usr/lib/swift/NBase.framework/NBase' (no such file, not in dyld cache)" error occurs.
A. Add NBase.xcframework as shown below.
The image below illustrates the process of adding NBase.xcframework to the project.

gamepot-UnitySDK07.png

gamepot-UnitySDK08.png

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

A. Open the Edit Scheme window (shortcut: CMD + SHIFT + ,), deselect API Validation from the Metal field.
The image below illustrates where to disable the Metal API Validation option.

gamepot-UnitySDK15.png