Unity SDK
    • PDF

    Unity SDK

    • PDF

    Article Summary

    The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.

    This page describes how to use GAMEPOT Unity SDK for game development in Unity. You can integrate the game and dashboard by installing the SDK and configuring the environment.

    Required specifications

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

    • Minimum specifications: 2018.4.0 or later
      (If you need support for a lower version of Unity, then make an inquiry through Contact Us. )
    • If you're updating from v.3.1.0 or earlier to the latest version,
      then refer to the Migration guide to perform the migration.
    • If you're using 2019.3.X or later,
      then make sure to see the additional settings described in GAMEPOT FAQ.
    • Unity Editor users on versions 2019.4.X, 2020.3.X, and 2021.1.X are recommended to use versions 2019.4.29f1, 2020.3.36f1, 2021.1.16f1, or later. (When building an AAB version, the version with the Unity Editor bug fixed; for versions 2020.3.35 and earlier, the version that fixes an app crash when connecting Bluetooth earphones when building Android 31.)

    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 the app is launched, it is displayed in the supported language in the SDK based on the device's language. If it is an unsupported language, it will be displayed in English.

    For IOS)

    • You must add the language you want to apply in XCode > localization
    • Upon building, the Version Code must increase in a unique form of whole numbers.

    SDK installation

    The following describes how to install GAMEPOT Unity SDK and configure a project in Unity.

    1. Log in to the dashboard with the admin account.
    2. Click the Download SDK > Unity menus, in that order, and then click Download.
    3. In Unity, click the Assets > Import Package > Custom Package... menus, in that order, and then load the GamePotUnityPlugin-xxxx.unitypackage file.

    Set Android environment

    To develop Android-based games using GAMEPOT Unity SDK, you need to set up the required environment for it.

    Set minimum specifications

    Use the following code to set up minimum specifications for installing and running the app.

    minSdkVersion: API 19 or later (Kitkat)
    

    Modify Gradle

    To edit the Gradle file, enter the values in the following code by referring to the table, and then change the settings using the code.

    • Open the ../Assets/Plugin/Android/mainTemplate.gradle file in your editor. (launcherTemplate.gradle file edited in Unity 2019.3.X version and later)
    • Customers who do not use Facebook login should set the facebook_app_id / fb_login_protocol_scheme value arbitrarily as shown below or disable the inclusion of the ../Assets/Plugins/Android/libs/gamepot-channel-facebook.aar file in the build.

    The value for gamepot_payment is blank as its default.

    ValueDescription
    gamepot_project_idProject ID issued by GAMEPOT
    (Check from the Project settings > General menu in the dashboard.)
    gamepot_storeEnter the store value google, one, or galaxy
    gamepot_app_titleApp title (FCM)
    gamepot_push_default_channelDo not change (name of the registered default channel)
    facebook_app_idApp ID issued by Facebook
    fb_login_protocol_schemeApp ID issued by Facebook
    facebook_client_tokenFacebook console > App > Settings > Advanced settings > Client token
    gamepot_elsa_projectidEnter the ELSA project ID when using the NAVER Cloud ELSA service
    (See Effective Log Search & Analytics)
    gamepot_regionType sg only when the GAMEPOT Dashboard creation Region is Singapore
    gamepot_license_urlEnter https://gamepot.apigw.ntruss.com/fw/jp-v1 only if the GAMEPOT dashboard creation Region is Japan
    ...
    android {
        ...
        defaultConfig {
            ...
            resValue "string", "gamepot_project_id", "" // required
            resValue "string", "gamepot_store", "google" // required
            resValue "string", "gamepot_app_title","@string/app_name" // required (fcm)
            resValue "string", "gamepot_push_default_channel","Default" // required (fcm)
            resValue "string", "facebook_app_id", "0" // optional (facebook)
            resValue "string", "fb_login_protocol_scheme", "fb0" // optional (facebook)
             resValue "string", "facebook_client_token", "" // Facebook console > App > Settings > Advanced settings > Client token optional (facebook)
            // resValue "string", "gamepot_elsa_projectid", "" // optional (ncp elsa)
             resValue "string", "gamepot_region", "" // Caution! Only if the gamepot region is Singapore , value as sg
             resValue "string", "gamepot_license_url", "" // Caution! Only if the gamepot region is Japan , value as https://gamepot.apigw.ntruss.com/fw/jp-v1
        }
        ...
    }
    

    Edit gradleTemplate (Unity version 2022.2 or later)

    Click Edit > Project Settings > Player > Publishing Settings > Custom Gradle Properties Template.

    • The Assets/Plugins/Android/gradleTemplate.properties file is created once you enable this option.

    image.png

    Add the following to the gradleTemplate.properties file.

    android.useAndroidX=true
    android.enableJetifier=true

    Set push notification icon

    You can set icons to display in the notification bar when receiving push messages. If you don't set it up separately, then the default image included in the SDK is used. You can set up icons that suit the game.

    If you create it using Android Asset Studio, it is convenient as the images are generated for each folder automatically.

    The following describes how to set push notification icons.

    1. As shown below, create each res/drawable folders in the project path, and add image files for each size.

      Folder nameCapacity
      /Assets/Plugins/Android/GamePotResources/res/drawable-mdpi/24x24
      /Assets/Plugins/Android/GamePotResources/res/drawable-hdpi/36x36
      /Assets/Plugins/Android/GamePotResources/res/drawable-xhdpi/48x48
      /Assets/Plugins/Android/GamePotResources/res/drawable-xxhdpi/72x72
      /Assets/Plugins/Android/GamePotResources/res/drawable-xxxhdpi/96x96

      For the Unity Engine 202x and later, you must put it in the GamePotResources.androidlib folder and add the corresponding resource folder to mainTemplate.gradle.

      ...
          implementation project('GamePotResources.androidlib')
      ...
      
    2. Rename the image file to ic_stat_gamepot_small.

    Set screen orientation

    The following describes how to set up a screen orientation that suits the game.

    1. Open the /Assets/Plugin/Android/AndroidManifest.xml file in Unity.
    2. Add the following code to the main activity, and then enter sensorLandscape or sensorPortrait as the value according to the game.
      ...
          <activity android:screenOrientation="sensorLandscape">
            <intent-filter>
              <action android:name="android.intent.action.MAIN" />
                ...
            </intent-filter>
          </activity>
      ...
      

    Set Android Resolver and Unity build

    Set up Android Resolver and Unity build to use the SDK, as shown below.

    • Android Resolver
      In Unity, select Use Jetifier in the Assets > Play Services Resolver > Android Resolver > Settings menu.
      Deselect Enable Resolution On Build / Enable Auto-Resolution / Patch gradle Template.properties.

    • Unity Build
      In Unity, click the File > Build Settings > Build System menus, in that order, and then select Gradle.

    iOS Preferences

    To develop iOS-based games using GAMEPOT Unity SDK, you need to set up the required environment for it.

    Configure project

    The following describes how to configure a project to set up the iOS environment.

    1. Add the GoogleService-Info.plist file acquired from the Google Firebase console to the Unity project.

    2. Edit the following settings from the project's GamePotConfig-Info.plist file by referring to the table.
      (If you do not use Facebook login, exclude GamePotFacebook.framework in the build.)

      Environment variablesDescription
      gamepot_project_idProject ID issued from GAMEPOT
      gamepot_facebook_app_idApp ID acquired from the Facebook console
      gamepot_facebook_display_nameName displayed in Facebook
      gamepot_facebook_client_token// Facebook console > App > Settings > Advanced settings > Client token
      gamepot_google_app_idGoogleService-Info file’s CLIENT_ID value
      gamepot_google_url_schemesGoogleService-Info file’s REVERSED_CLIENT_ID value
      gamepot_elsa_projectidProject ID when using NAVER Cloud ELSA
      gamepot_regionType “sg” only when the GAMEPOT Dashboard creation Region is Singapore
      gamepot_license_urlEnter https://gamepot.apigw.ntruss.com/fw/jp-v1 only if the GAMEPOT dashboard creation Region is Japan
    3. Select a target, and then add the following option for acquiring user permissions in the Info > Custom iOS Target Properties menu. ( XCode standard )

      • This user permissions are used for uploading files in the GAMEPOT customer center.
        NSCameraUsageDescription, NSPhotoLibraryUsageDescription, NSMicrophoneUsageDescription
      • Starting with iOS 14, permissions must be granted by the user to acquire IDFA values. Therefore, if you're using a pop-up that asks for user permissions when acquiring IDFA values, then you need to add the following user permission acquisition option in Targets >> Info >> Custom iOS Target Properties. (Purpose for collection and description of where it should be used must be added.)
        NSUserTrackingUsageDescription

    E. g., GAMEPOT sample page
    In the File > Build Settings menu, add GamePotSample > Scene > Login, Main, and then click Build to see the sample page.

    Reset

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

    using GamePotUnity;
    public class GamePotLoginSampleScene : MonoBehaviour {
        void Awake() {
            GamePot.initPlugin();
        }
        void Start () {
            GamePot.setListener (class that inherits from GamePotInterface.cs);
        }
    
    }
    
    ex)
    public class GamePotSampleListener : MonoBehaviour , IGamePot {
        ....
    }
    

    Set error codes

    Use the following code to set up error codes.

    public class NError
    {
        // Unknown error
        public static readonly int CODE_UNKNOWN_ERROR           = 0;
        // Initialization failed
        public static readonly int CODE_NOT_INITALIZE           = 1;
        // Invalid parameter
        public static readonly int CODE_INVAILD_PARAM           = 2;
        // No member ID data
        public static readonly int CODE_MEMBERID_IS_EMPTY       = 3;
        // Not logged in
        public static readonly int CODE_NOT_SIGNIN              = 4;
        // Network module is not initialized
        public static readonly int CODE_NETWORK_MODULE_NOT_INIT = 3000;
        // Network connection error or timeout occurs
        public static readonly int CODE_NETWORK_ERROR           = 3001;
        // Server-side error
        public static readonly int CODE_SERVER_ERROR            = 4000;
        // HTTP response code is not successful
        public static readonly int CODE_SERVER_HTTP_ERROR       = 4001;
        // Network connection error or timeout occurred
        public static readonly int CODE_SERVER_NETWORK_ERROR    = 4002;
        // Error occurs when parsing data received from the server
        public static readonly int CODE_SERVER_PARSING_ERROR    = 4003;
        // Unknown error occurred during payment or error is received from the store
        public static readonly int CODE_CHARGE_UNKNOWN_ERROR    = 5000;
        // No product ID specified
        public static readonly int CODE_CHARGE_PRODUCTID_EMPTY  = 5001;
        // Incorrect product ID
        public static readonly int CODE_CHARGE_PRODUCTID_WRONG  = 5002;
        // Consume error
        public static readonly int CODE_CHARGE_CONSUME_ERROR    = 5003;
    
        // error Code
        public int code { get; set; }
        // error Message
        public string message { get; set; }
    }
    

    You can integrate various login SDK features such as Google, Facebook, and NAVER, and use them in GAMEPOT Unity SDK.

    Settings before use

    To use the login-related SDK features, you need to declare login-related code after completing necessary console settings.

    Set up Google login environment

    The following describes how to set up Google Firebase console to use the login feature.

    1. Copy the google-service.json file for Android you obtained from the Google Firebase console and paste it in the /Assets/Plugins/Android/ path.
    2. Add the SHA-1 value of the keystore file used when configuring the APK to the Firebase console.
    • When attempting Google login, if it fails with the onCancel response, you can resolve it by taking the following steps.
      • Check if the google-service.json was correctly applied.
      • Check if the keystore used when configuring the APK and the keystore that the SHA-1 value was extracted from for registration to the Firebase console are identical
      • Verify that the build was made with the package name registered in the Firebase console.

    Set up Facebook login environment

    The following describes how to set up Facebook console to use the login feature.

    1. From the Facebook for Developers console, select the app type as None, Consumer, or Instant Games, and create the app.
    2. Add the key hash value of the keystore file used when configuring the APK to the Facebook for Developers console.
    3. Add the app ID and relevant information acquired from the Facebook for Developers console.
    • Android
      • Edit mainTemplate.gradle. (Edit launcherTemplate.gradle in Unity 2019 or later.)
      ...
      defaultConfig {
          resValue "string", "facebook_app_id", "{App ID}"
          resValue "string", "fb_login_protocol_scheme", "fb{App ID}"
          resValue "string", "facebook_client_token", "" // Facebook console > App > Settings > Advanced settings > Client token optional (facebook)
      }
      ...
      
      


    • iOS
      • Edit the GamepotConfig-info.plist file
      gamepot_facebook_app_id // Facebook app ID
      gamepot_facebook_display_name // Name displayed in Facebook
      gamepot_facebook_client_token //  // Facebook console > App > Settings > Advanced settings > Client token 
      
      Add the following when checking with SourceCode.
      ...
       <key>gamepot_facebook_app_id</key>
       <string>xxxxxx</string>
       <key>gamepot_facebook_display_name</key>
       <string>xxxxxx</string>
       <key>gamepot_facebook_client_token</key>
       <string>xxxxxx</string>
       ...
      
    1. Add the framework below to Project/Assets/Plugins/IOS/Frameworks
      • FBSDKLoginKit.xcframework, FBSDKCoreKit_Basics.xcframework, FBSDKCoreKit.xcframework, FBAEMKit.xcframework, FBSDKCoreKit.framework, GamePotFacebook.framework

    Set up Apple login environment

    To set up an iOS-only Apple login environment, select Target in your project and add the Sign In with Apple Capability in the Signing & Capabilities menu.

    Set up Game Center login environment

    The following describes how to set up the Game Center login environment for iOS.

    1. Select GamePotGameCenter.framework in the project Assets/Plugins/IOS/etcFrameworks/ path, and select iOS settings in the Select platforms for plugin list.
    2. In Xcode, select Target and add Gamekit.framework to the Build Phases > Linked Binary With Libraries menu.
    3. Add the GameCenter Capability from the Signing & Capabilities menu.

    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.

    • Method 1

      GamePot.login(NCommon.LoginType);
      
      // Login success
      public void onLoginSuccess(NUserInfo userInfo)
      {
      }
      // Login failed
      public void onLoginFailure(NError error)
      {
          // Display the message using error.message.
      }
      // Login canceled
      public void onLoginCancel()
      {
          // Login canceled by the user.
      }
      // Force update (use this method when the store version does not match the client version)
      public void onNeedUpdate(NAppStatus status)
      {
          // You need to create and display a pop-up window based on the status information passed in a parameter. Choose between the following two methods to configure the pop-up window:
          // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
          // Case 2: Call the following code and use the SDK's own pop-up window.
          // GamePot.showAppStatusPopup(status.ToJson());
      }
      // Check (call this when Check is enabled in the dashboard.)
      public void onMainternance(NAppStatus status)
      {
           // You need to create and display a pop-up window based on the status information passed in a parameter. Choose between the following two methods to configure the pop-up window:
          // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
          // Case 2: Call the following code and use the SDK's own pop-up window.
          // GamePot.showAppStatusPopup(status.ToJson());
      }
      // End the app
      public void onAppClose()
      {
          // When implementing the force update or maintenance feature with the Case 2 method, it may force end the app. Implement it here to enable ending the app.
      }
      
    • Method 2

      GamePot.login(NCommon.LoginType.GOOGLE, GamePotCallbackDelegate.CB_Login);
      
      GamePot.login(NCommon.LoginType.GOOGLE, (resultState, userInfo, appStatus, error) => {
          switch (resultState)
          {
              case NCommon.ResultLogin.SUCCESS:
              // login success
              break;
              case NCommon.ResultLogin.CANCELLED:
              // login cancel
              break;
              case NCommon.ResultLogin.FAILED:
              // login fail
              break;
              case NCommon.ResultLogin.NEED_UPDATE:
                  // You need to create and display a pop-up window based on the appStatus information passed in a parameter. Choose between the following two methods to configure the pop-up window:
                  // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
                  // Case 2: Call the following code and use the SDK's own pop-up window.
                  // GamePot.showAppStatusPopup(status.ToJson());
              break;
              case NCommon.ResultLogin.MAINTENANCE:
                  // You need to create and display a pop-up window based on the appStatus information passed in a parameter. Choose between the following two methods to configure the pop-up window:
                  // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
                  // Case 2: Call the following code and use the SDK's own pop-up window.
                  // GamePot.showAppStatusPopup(status.ToJson());
              break;
              case NCommon.ResultLogin.APP_CLOSE:
                  // When implementing the force update or maintenance feature with the Case 2 method, it may force end the app. Implement it here to enable ending the app.
              break;
              default:
              break;
          }
      });
      

    Define Log-inType, NUserInfo, and NAppStatus

    Use the following code to set up various parameters for the login feature.

    • LoginType
      public enum LoginType
      {
          NONE,
          GOOGLE,
          GOOGLEPLAY,
          FACEBOOK,
          NAVER,
          GAMECENTER,
          TWITTER,
          LINE,
          APPLE,
          GUEST,
          THIRDPARTYSDK
      }
      
    • NUserInfo
      public class NUserInfo
      {
          public string memberid { get; set; }        // Unique user ID
          public string name { get; set; }            // Name
          public string profileUrl { get; set; }      // Profile URL (if applicable)
          public string email { get; set; }           // Email (if applicable)
          public string token { get; set; }           // User validation token (used by the Token Authentication API)
          public string userid { get; set; }          // Social media ID
      }
      
    • NAppStatus
      public class NAppStatus
      {
          public string type { get; set; }        // AppStatus type, represents maintenance when "maintenance," and update when "needupdate"
          public string message { get; set; }     // Maintenance settings: message entered in dashboard
          public string url { get; set; }         // Maintenance settings: URL entered in dashboard
          public string currentAppVersion { get; set; }   // Update: current app version
          public string updateAppVersion { get; set; }    // Update: app version entered in dashboard
          public int currentAppVersionCode { get; set; }  // Update: current app code
          public int updateAppVersionCode { get; set; }   // Update: app version code entered in dashboard
          public bool isForce { get; set; }           // Update: true if force update is enabled in dashboard
          public string resultPayload { get; set; }   // This is a JSON value passed from the client SDK; you can ignore it.
          public double startedAt { get; set; }       // Maintenance: start time
          public double endedAt { get; set; }       // Maintenance: end time
      }
      

    Set up permission request pop-up to acquire IDFA value

    Use the following code to use the permission request pop-up window to acquire the user IDFA value in the iOS platform.

    // The pop-up window to request permissions for the IDFA value can be displayed arbitrarily.
    // After permissions are acquired, the pop-up window does not appear, even when the method is called.
    
    GamePot.requestTrackingAuthorization((NResultTrackingAuthorizationresultState) =>
    {
       // Handling the acquired NResultTrackingAuthorizationresultState..
    });
    


    • NResultTrackingAuthorizationresultState definition
      public class NResultTrackingAuthorization
      {
          public NCommon.ResultTrackingAuthorization authorization { get; set; }
      }
      
      public enum ResultTrackingAuthorization
      {
          ATTrackingManagerAuthorizationStatusNotDetermined,
          ATTrackingManagerAuthorizationStatusRestricted,
          ATTrackingManagerAuthorizationStatusDenied,
          ATTrackingManagerAuthorizationStatusAuthorized,
          ATTrackingManagerAuthorizationStatusUnknown
      }
      

    Acquire member's unique ID

    Use the following code to acquire game member's unique ID value.

    GamePot.getMemberId();
    

    Use login feature by account

    Use the following code to apply settings to use the login feature by account.

    NAVER login

    To use the NAVER login feature, select Login with NAVER IDas the API to use in the NAVER Developers console, register the app, and then use the following code.

    • Android
      • Edit mainTemplate.gradle
      ...
      defaultConfig {
          resValue "string", "gamepot_naver_clientid", "abcdefg1234567890"
          resValue "string", "gamepot_naver_secretid", "hijklmn"
      }
      ...
      
      // Enter the Client ID acquired from the NAVER Developers console for the gamepot_naver_clientid value and the client secret in the gamepot_naver_secretid value.
          ```
      


    • iOS
      • Edit the GamepotConfig-info.plist file
      gamepot_naver_clientid // Client ID to be used in NAVER
      gamepot_naver_secretid // Secret ID to be used in NAVER
      gamepot_naver_urlscheme // URL scheme to be used in NAVER
      
      Add the following when checking with SourceCode.
      ...
       <key>gamepot_naver_clientid</key>
       <string>xxxxxx</string>
       <key>gamepot_naver_secretid</key>
       <string>xxxxxx</string>
       <key>gamepot_naver_urlscheme</key>
       <string>xxxxxx</string>
       ...
      
      • Add the URL scheme registered in Set login with NAVER ID in the project's Info > URL Types menu

    LINE login

    To use the LINE login feature, add the package name used when configuring the APK, SHA-1 value of the keystore, and URL scheme value to the LINE Developers console, and then use the following code.

    • Android
      • Edit mainTemplate.gradle
      ...
      defaultConfig {
          resValue "string", "gamepot_line_channelid","xxxxxxx"
      }
      ...
      
      // Enter the Client ID acquired from the LINE Developers console to the gamepot_line_channelid value.
      


    • iOS
      • Edit the GamepotConfig-info.plist file
      gamepot_line_channelid // Client ID to be used in NAVER
      gamepot_line_url_schemes // Line URL scheme (line3rdp.{Project bundle identifier})
      
      Add the following when checking with SourceCode.
      ...
       <key>gamepot_line_channelid</key>
       <string>xxxxxx</string>
       <key>gamepot_line_url_schemes</key>
       <string>xxxxxx</string>
       ...
      

    Apple web login

    To use the Apple web login feature, set up Apple ID login in the Project settings > General menu in the dashboard and add the gamepot-channel-apple-signin.aar to the /Assets/Plugins/Android/libs path.

    Automatic login feature

    To use the auto login feature through the API that delivers the last login information of the member, use the following code.

    NCommon.LoginType type = GamePot.getLastLoginType();
    if(type != NCommon.LoginType.NONE) {
    {
        // Log in with the user's last login type.
        GamePot.login(type);
    }
    else
    {
        // The user logs in the game for the first time, or is currently logged out. Move to the login page where the user can log in.
    }
    

    Logout feature

    Use the following code to use the logout feature.

    • Method 1
    GamePot.logout();
    
    /// Logout succeeded
    public void onLogoutSuccess()
    {
    }
    
    /// Logout failed
    public void onLogoutFailure(NError error)
    {
        // Display the message using error.message.
    }
    
    • Method 2
    GamePot.logout(GamePotCallbackDelegate.CB_Common);
    
    GamePot.logout((success, error) => {
       if(success)
       {
           // Logout succeeded
       }
       else
       {
            // Logout failed
            // Display the message using error.message.
       }
    });
    
    

    Membership Withdrawal Feature

    Use the following code to use the membership withdrawal feature.

    • Method 1
    GamePot.deleteMember();
    
    /// Membership withdrawal succeeded
    public void onDeleteMemberSuccess() {
    }
    
    /// Membership withdrawal failed
    public void  onDeleteMemberFailure(NError error) {
        // Display the message using error.message.
    }
    
    • Method 2
    GamePot.deleteMember(GamePotCallbackDelegate.CB_Common);
    
    GamePot.deleteMember((success, error) => {
       if(success)
       {
            // Membership withdrawal succeeded
       }
       else
       {
            // Membership withdrawal failed
            // Display the message using error.message.
       }
    });
    

    Login Validation Feature

    After the login is complete, the login information can be passed from the developer server to the GAMEPOT server to perform login validation.

    For more information, see Request login validation.

    Integrate external account

    You can connect or disconnect multiple external accounts to a game account.

    Account integration feature

    Use the following code to use the integration feature to various external accounts including Google, Facebook, and NAVER.

    • Method 1
    public enum LinkingType
    {
        GOOGLEPLAY,
        GAMECENTER,
        GOOGLE,
        FACEBOOK,
        NAVER,
        TWITTER,
        LINE,
        APPLE
    }
    
    void GamePot.createLinking(NCommon.LinkingType.XXXXX);
    
    /// Cancel account connection.
    public void onCreateLinkingCancel() {
        // Account linkage canceled by the user
    }
    
    /// Account connection succeeded.
    public void onCreateLinkingSuccess(NUserInfo userInfo) {
    }
    
    /// Account connection failed.
    public void onCreateLinkingFailure(NError error) {
        // Display the message using error.message.
    }
    
    • Method 2
    public enum LinkingType
    {
        GOOGLEPLAY,
        GAMECENTER,
        GOOGLE,
        FACEBOOK,
        NAVER,
        TWITTER,
        LINE,
        APPLE
    }
    
    void GamePot.createLinking(NCommon.LinkingType.XXXXX, GamePotCallbackDelegate.CB_CreateLinking);
    
    GamePot.createLinking(NCommon.LinkingType.XXXXX, (resultState, userInfo, error) => {
          switch (resultState)
        {
            case NCommon.ResultLinking.SUCCESS:
            // Account connection succeeded.
            break;
            case NCommon.ResultLinking.CANCELLED:
            // Cancel account connection.
            break;
            case NCommon.ResultLinking.FAILED:
            // Account connection failed.
            break;
            default:
            break;
        }
    });
    

    Integration list check feature

    Use the following code to check the list of external accounts connected to the account.

    List<NLinkingInfo> linkedList = GamePot.getLinkedList();
    
    // Define link information
    public class NLinkingInfo
    {
        public LinkingType provider { get; set; }  // google, facebook, naver, apple..
    }
    

    Integration removal feature

    Use the following code to use the integration removal feature from external accounts.

    • Method 1
    void GamePot.deleteLinking(NCommon.LinkingType.XXXXX);
    
    /// Account linkage removal succeeded
    public void onDeleteLinkingSuccess() {
    }
    
    /// Account disconnection failed
    public void onDeleteLinkingFailure(NError error) {
        // When account linkage removal fails
        // Display the message using error.message.
    }
    
    • Method 2
    void GamePot.deleteLinking(NCommon.LinkingType.XXXXX, GamePotCallbackDelegate.CB_Common);
    
    GamePot.deleteLinking(NCommon.LinkingType.XXXXX, (success, error) => {
        if(success)
        {
           // Account linkage removal succeeded
        }
       else
       {
            // When account linkage removal fails
            // Display the message using error.message.
        }
    });
    

    Payment feature

    Note

    GAMEPOT payment is only supported for the expendable in-app product type. Only the V21 version of the in-app SDK is supported for ONE Store.

    • ONE Store in-app SDK includes: gamepot-billing-onestore.aar, sdk-auth-1.0.2.aar, sdk-base-1.0.3.aar, sdk-iap-21.00.00.aar
    • Include Galaxy Store in-app SDK: gamepot-billing-galaxystore.aar
    • Include My Card in-app SDK: gamepot-billing-mycard.aar (Make sure that this is not included in Google Store builds.)

    You can use the payment feature for in-app purchases.

    For ONE Store, the following statement needs to be added in the AndroidManifest.xml file.

     <queries>
          <intent>
              <action android:name="com.onestore.ipc.iap.IapService.ACTION" />
          </intent>
          <intent>
              <action android:name="android.intent.action.VIEW" />
              <data android:scheme="onestore" />
          </intent>
      </queries>
    

    In-app product search feature

    Use the following code to use the feature to view information of products registered in the store.

    This API must be called after successfully logging in. The getPurchaseItems API is an asynchronous API that returns what is forwarded to it from the store's in-app SDK, so depending on the timing of the call, it may return an empty value. (Based on environments that support payment)

    [Case1]:
    
    NPurchaseItem[] items = GamePot.getPurchaseItems();
    foreach(NPurchaseItem item in items) {
        Debug.Log(item.productId);        // Product ID
        Debug.Log(item.price);            // Price
        Debug.Log(item.title);            // Title
        Debug.Log(item.description);    // Description
    }
    
    [Case2]:
    
    GamePot.getPurchaseDetailListAsync((bool success, NPurchaseItem[] purchaseInfoList, NError error) =>
    {
       // string result = "data is empty!";
        if (success)
        {
             //PurchaseDetailList API Success
            // if (purchaseInfoList != null)
            //     result = purchaseInfoList[0].productId;
            //if (purchaseInfoList.Length > 1)
            //{
            //    for (int i = 1; i < purchaseInfoList.Length; i++)
            //        result += "\n" + purchaseInfoList[i].productId;
            //}
        }
        else
        {
            // API errors 
            // result = error.ToJson();
        }
    
    });
    
    
    public class NPurchaseItem
    {
        public string productId { get; set; }   // Product ID
        public string type { get; set; }        // Product type. Fix as "inapp"
        public string price { get; set; }       // Price; Google Store: 0.99 USD, other stores: 0.99
        public string price_amount { get; set; }
        public string price_amount_micros { get; set; }
        public string price_currency_code { get; set; } // Currency code; e.g., KRW, USD
        public string price_with_currency { get; set; } // (Recommended for UI display) The combined value of the currency and price. The currency unit will not be sent for ONE Store. E.g., $0.99
        public string title { get; set; }       // Product name
        public string description { get; set; } // Product description
    }
    
    [Case3]:
    
    GamePot.getPurchaseDetailListAsync();
    
    public void onPurchaseDetailListSuccess(NPurchaseItem[] purchaseInfoList)
    {
        //PurchaseDetailList API Success
    }
    
    public void onPurchaseDetailListFailure(NError error)
    {
           // API errors 
    }
    

    Payment attempt feature

    You can use the payment attempt feature in both Google Play Store and Apple App Store with a single payment API.
    (For the ONE Store version, the length of uniqueId+serverId+playerId+etc should be less than 85 bytes for payments to be made.)

    Use the following code to use the payment attempt feature.

    • Method 1

    // productId: product ID registered in the store
    // uniqueId: receipt ID that is separately managed
    // serverId: server ID of the character for whom the payment was made
    // playerId: character ID of the character for whom the payment was made
    // etc :other information of the character that made the purchase

    
    GamePot.purchase(string productId);
    
    GamePot.purchase(string productId, string uniqueId);
    
    GamePot.purchase(string productId, string uniqueId, string serverId, string playerId, string etc);
    
    /// In-app payment succeeded
    public void onPurchaseSuccess(NPurchaseInfo purchase) {
    }
    
    /// In-app payment failed
    public void onPurchaseFailure(NError error) {
        // In-app payment failed
        // Display the message using error.message.
    }
    
    /// In-app payment failed
    public void onPurchaseCancel() {
    }
    
    • Method 2
    // productId: product ID registered in the store
    GamePot.purchase(string productId, GamePotCallbackDelegate.CB_Purchase);
    
    GamePot.purchase(string productId, string uniqueId, GamePotCallbackDelegate.CB_Purchase);
    
    GamePot.purchase(string productId, string uniqueId, string serverId, string playerId, string etc, GamePotCallbackDelegate.CB_Purchase);
    
    GamePot.purchase(productId, (resultState, purchaseInfo, error) => {
          switch (resultState)
        {
            case NCommon.ResultPurchase.SUCCESS:
            // purchase success
            break;
            case NCommon.ResultPurchase.CANCELLED:
            // purchase cancel
            break;
            case NCommon.ResultPurchase.FAILED:
            // purchase fail
            break;
            default:
            break;
        }
    });
    

    Payment item information acquisition feature

    Use the following code to use the feature to acquire in-app payment item information delivered from the store.

    public class NPurchaseInfo
    {
        public string price { get; set; }               // Price of the purchased item
        public string productId { get; set; }   // ID of purchased item
        public string currency { get; set; }            // Currency (KRW/USD) of purchsed item
        public string orderId { get; set; }             // Store order ID
        public string productName { get; set; }         // Name of purchsed item
        public string gamepotOrderId { get; set; }      // Order ID generated by GAMEPOT (This value is not provided.) 
        public string uniqueId { get; set; }            // Receipt ID separately managed by the developer
        public string serverId { get; set; }            //  Server ID of the character that made the purchase
        public string playerId { get; set; }            // Server ID of the character that made the purchase
        public string etc { get; set; }                 // Other information of the character that made the purchase
        public string signature { get; set; }           // Payment signature
        public string originalJSONData { get; set; }    // Receipt data
    }
    

    Payment item provision feature

    You can set it so that the payment request is sent to the developer server only upon the completion of validation, which compares it to the receipt history of the purchased store.
    For more information, see Request item provision.

    My Card payment

    My Card library: gamepot-billing-mycard.aar

    Note

    Check the FacServiceID/KEY value for integration with My Card through My Card's side.

    1. In Dashboard >> Payment >> IAP, enter Store type: Google item > Add price > Enter currency (e.g., TWD) and price information, and then save.

    2. Add My Card to the Dashboard >> Project Settings >> External Payment Item, and check if the FacService ID / Sign Key is entered correctly.

    3. The payment will call the SDK's following code.
      GamePot.getInstance().purchase("product id");

      • For the format of calling payment items while using My Card, an error occurs when you call the existing GamePot.getInstance().getPurchaseDetailList();.
        Call GamePot.getInstance().getPurchaseThirdPaymentsDetailList(); instead.
    4. Remove the name from the level in the ../Assets/Plugins/Android/AndroidManifest.xml file.

      <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
      <application android:icon="@drawable/app_icon"
          android:label="@string/app_name"
          android:allowBackup="false"
          tools:replace="android:allowBackup"
          >
    
    1. Configure the ../Assets/Plugins/Android/mainTemplate.gradle file as follows.
      (launcherTemplate.gradle file edited in Unity 2019.3.X version and later)
    resValue "string", "gamepot_store", "google"
    resValue "string", "gamepot_payment", "mycard" // This only works if the store is Google.
    
    1. Check if the ../Assets/Plugins/Android/libs folder contains gamepot-billing-mycard.aar.

    External payment

    To integrate with an external payment module, see Integrate external payment service to complete the settings, and then use the following code.

    • Method 1
    GamePot.purchaseThirdPayments(string productId);
    
    // Data format returned is the same as getPurchaseItems().
    GamePot.getPurchaseThirdPaymentsItems();
    
    • Method 2
    GamePot.purchaseThirdPayments(string productId, GamePotCallbackDelegate.CB_Purchase);
    
    // Data format returned is the same as getPurchaseItems().
    GamePot.purchase(productId, (resultState, purchaseInfo, error) => {
          switch (resultState)
        {
            case NCommon.ResultPurchase.SUCCESS:
            // purchase success
            break;
            case NCommon.ResultPurchase.CANCELLED:
            // purchase cancel
            break;
            case NCommon.ResultPurchase.FAILED:
            // purchase fail
            break;
            default:
            break;
        }
    });
    

    Login UI provided by SDK

    You can use the login UI provided by GAMEPOT Unity SDK in a completed form.

    Call login UI provided by SDK

    Use the following code to call login UI provided by GAMEPOT Unity SDK.

    • Method 1
    public class NLoginUIInfo
    {
        public NCommon.LoginType[] loginTypes { get; set; }     // Type of login UI to display (array)
        public bool showLogo { get; set; }                      // Whether to display the image logo
    }
     NLoginUIInfo info = new NLoginUIInfo();
    
    //Type of Login UI to call
     info.loginTypes = new NCommon.LoginType[]
     {
         NCommon.LoginType.GOOGLE,
         NCommon.LoginType.FACEBOOK,
         NCommon.LoginType.GUEST
         ...
     };
     info.showLogo = true;
    
    GamePot.showLoginWithUI(info);
    
    // This is the same as the regular login API response logic. However, for onLoginCancel/onLoginFailure, it will be processed as a toast message at the native level.
    
    // Login success
    public void onLoginSuccess(NUserInfo userInfo)
    {
    }
    // Force update (use this method when the store version does not match the client version)
    public void onNeedUpdate(NAppStatus status)
    {
       // You need to create and display a pop-up window based on the status information passed in a parameter. Choose between the following two methods to configure the pop-up window:
       // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
       // Case 2: Call the following code and use the SDK's own pop-up window.
       // GamePot.showAppStatusPopup(status.ToJson());
    }
    // Check (call this when Check is enabled in the dashboard.)
    public void onMainternance(NAppStatus status)
    {
       // You need to create and display a pop-up window based on the status information passed in a parameter. Choose between the following two methods to configure the pop-up window:
       // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
       // Case 2: Call the following code and use the SDK's own pop-up window.
       // GamePot.showAppStatusPopup(status.ToJson());
    }
    // End the app
    public void onAppClose()
    {
       // When implementing the force update or maintenance feature with the Case 2 method, it may force end the app. Implement it here to enable ending the app.
    }
    
    public void onLoginExit()
    {
       // When closing the provided log-in UI
    }       
           
    
    • Method 2
    GamePot.showLoginWithUI(NLoginUIInfo, GamePotCallbackDelegate.CB_Login);
    
     GamePot.showLoginWithUI(NLoginUIInfo, (resultState, userInfo, appStatus, error) => {
        switch (resultState)
        {
            case NCommon.ResultLogin.SUCCESS:
              // login success
            break;
            case NCommon.ResultLogin.EXIT:
                // When closing the provided log-in UI
            break;
             case NCommon.ResultLogin.NEED_UPDATE:
                // You need to create and display a pop-up window based on the status information passed in a parameter. Choose between the following two methods to configure the pop-up window:
                // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
                // Case 2: Call the following code and use the SDK's own pop-up window.
                // GamePot.showAppStatusPopup(appStatus.ToJson());
            break;
             case NCommon.ResultLogin.MAINTENANCE:
                 // You need to create and display a pop-up window based on the status information passed in a parameter. Choose between the following two methods to configure the pop-up window:
                // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
                // Case 2: Call the following code and use the SDK's own pop-up window.
                // GamePot.showAppStatusPopup(appStatus.ToJson());
            break;
             case NCommon.ResultLogin.APP_CLOSE:
                // When implementing the force update or maintenance feature with the Case 2 method, it may force end the app. Implement it here to enable ending the app.
            break;
            default:
            break;
        }
    });
    

    Set logo image for provided login UI

    You can set the image displayed at the top of the provided login UI. If you don't set it up separately, then the default image included in the SDK is used. You can set up images that suit the game.

    Set logo image for Android

    The following describes how you can set the image for the provided login UI for Android.

    1. As shown below, create REW/drawable folders each and add image files for each size.
      Folder nameCapacity
      /Assets/Plugins/Android/GamePotResources/res/drawable-mdpi/78x55
      /Assets/Plugins/Android/GamePotResources/res/drawable-hdpi/116x82
      /Assets/Plugins/Android/GamePotResources/res/drawable-xhdpi/155x110
      /Assets/Plugins/Android/GamePotResources/res/drawable-xxhdpi/232x165
      /Assets/Plugins/Android/GamePotResources/res/drawable-xxxhdpi/310x220
    2. Change the name of the image files to ic_stat_gamepot_login_logo.png.

    Set logo image for iOS

    To set the self-provided login UI image for iOS, change file name of the image you want to set (recommended size: 310 x 220) to ic_stat_gamepot_login_logo.png, and then replace it with the existing file with the same name in GamePot.bundle.

    Coupon feature

    Use the following code to use the feature that processes the coupon entered by the user as used.

    • Method 1
    GamePot.coupon(string couponNumber); // Coupon code
    
    GamePot.coupon(string couponNumber, string userData); // Coupon code, user information
    
    /// Succeeded in using coupon
    public void onCouponSuccess() {
    }
    
    /// Failed to use coupons.
    public void onCouponFailure(NError error) {
        // Display the message using error.message.
    }
    
    • Method 2
    GamePot.coupon(string couponNumber, GamePotCallbackDelegate.CB_Common); // Coupon code
    
    GamePot.coupon(string couponNumber, string userData, GamePotCallbackDelegate.CB_Common);    // Coupon code, user information
    
    GamePot.coupon(couponNumber, (success, error) => {
       if(success)
       {
           // Succeeded in using coupon
       }
       else
       {
            // Failed to use coupons.
            // Display the message using error.message.
       }
    });
    

    Provide item

    When a coupon is used successfully, it requests the provision of items to the developer server.

    For more information, see Request item provision.

    Push feature

    You can activate or deactivate all push, night push, and ad push features, and use the local push feature.
    Set ad push settings to true if you wish to use the push feature. (If the ad push value is false, push messages don't come through regardless of the general/night push settings.)

    Set general push

    Use the following code to set up general push.

    • Method 1
        GamePot.setPushStatus(bool pushEnable);
    
        /// Push status change succeeded
        public void onPushSuccess() {
        }
    
        /// Push status change failed
        public void onPushFailure(NError error) {
    
            // When the push status change fails, display the message using error.message.
        }
    
    • Method 2
    void GamePot.setPushStatus(bool pushEnable, GamePotCallbackDelegate.CB_Common);
    
        GamePot.setPushStatus(pushEnable, (success, error) => {
            if(success)
            {
                // Push status change succeeded
            }
           else
           {
                // Push status change failed. Display the message using error.message.
            }
        });
        
    

    Set night push

    Use the following code to set up night push.

    • Method 1
    GamePot.setPushNightStatus(bool nightPushEnable);
    
        /// Push status change succeeded
        public void onPushNightSuccess() {
        }
    
        /// Push status change failed
        public void onPushNightFailure(NError error) {
    
            // When the night push status change fails, display the message using error.message.
        }
    
    • Method 2
        void GamePot.setPushNightStatus(bool nightPushEnable, GamePotCallbackDelegate.CB_Common);
    
        GamePot.setPushNightStatus(nightPushEnable, (success, error) => {
            if(success)
            {
                // Push status change succeeded
            }
           else
           {
                // Night push status change failed. Display the message using error.message.
            }
        });
    

    Set general/night/ad push at once

    For games that check whether users will allow push before login, make sure to call the following code after login.

    • Method 1
    GamePot.setPushStatus(bool pushEnable, bool nightPushEnable, bool adPushEnable);
    
    /// Push status change succeeded
    public void onPushStatusSuccess() {
    }
    
    /// Push status change failed
    public void onPushStatusFailure(NError error) {
    
        // When the push status change fails, notify the user with error.message using methods such as pop-ups.
    }
    
    • Method 2
    void GamePot.setPushStatus(bool pushEnable, bool nightPushEnable, bool adPushEnable, GamePotCallbackDelegate.CB_Common);
    
    GamePot.setPushStatus(pushEnable, nightPushEnable, adPushEnable, (success, error) => {
        if(success)
        {
            // Push status change succeeded
        }
       else
       {
            // Push status change failed. Notify the user with error.message using methods such as pop-ups.
        }
    });
    

    Check push status

    Use the following code to check the current push status.

    NPushInfo pushInfo = GamePot.getPushStatus();
    
    // pushInfo.enable indicates whether to allow Push
    // pushInfo.night indicates whether to allow Night Push
    

    Image push feature

    The following describes how to add the notification service extension program to receive and process notification images on the iOS app.

    1. Click the Target menu in the project, select Notification Service Extension and select Next.
    2. Enter the Project Name, and click Finish.
    3. Edit the NotificationService.h file of the created Notification Service Extension module as below.
      // Import GamePot/GamePotNotificationServiceExtension.h
      // #import <UserNotifications/UserNotifications.h>
      #import <GamePot/GamePotNotificationServiceExtension.h
      // Inherit GamePotNotificationServiceExtension instead of UNNotificationServiceExtension
      // @interface NotificationService : UNNotificationServiceExtension
      @interface NotificationService : GamePotNotificationServiceExtension
      @end
      
    4. Edit the NotificationService.m file of the created Notification Service Extension module as below.
      ...
      
      - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
          // self.contentHandler = contentHandler;
          // self.bestAttemptContent = [request.content mutableCopy];
          // Modify the notification content here...
          // self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title];
          // self.contentHandler(self.bestAttemptContent);
          [super didReceiveNotificationRequest:request withContentHandler:contentHandler];
      }
      
      ...
      
    5. In the created Notification Service Extension module, click the Targets > Build Phases > Link Binary With Libraries menus, in that order, and then add GamePot.framework.

    Local push feature

    You can display push notifications independently from the device, without going through the push message server.

    Use the following code to register push and display local push at a specified time.

    int pushId = GamePot.sendLocalPush(DateTime.Parse("2018-01-01 00:00:00"), "title", "content");
    
    // The return value of the pushid is managed by the developer. 
    

    Cancel registered local push

    To cancel a previously registered push using the pushid value acquired when registering the local push, use the following code.

    GamePot.cancelLocalPush(/*pushId you acquired when registering push*/);
    

    Notice image display feature

    You can set to display the image uploaded to the Notice menu in the dashboard. Recommended sizes for images are shown below.

    • Size: 720 x 1200 (portrait), 1280 x 640 (landscape)
    • File size: 250 KB or smaller

    Use the following code to display the image uploaded to the Notice menu in the dashboard.

    GamePot.showNotice(bool Flag = true);
    
    // true: apply Do not show for 24 hours
    // false: force exposure regardless of Do not show for 24 hours
    
    GamePot.showEvent(string Type)
    
    // Type: only show the images that fall under the classification name set in the Notice > Classification menu in the dashboard
    
    public void onReceiveScheme(string scheme)
    {
        // Send the scheme value set in the GAMEPOT dashboard
    }
    

    Support feature

    By integrating the dashboard, you can use features such as customer inquiry, call policies and terms UI, and consent collection.

    Customer inquiry feature

    You can use the customer inquiry feature where members can send in inquiries and managers can answer them. It is integrated with the Support > Customer inquiry menu in the dashboard.

    The customer inquiry UI is changed to a language among Korean, English, Japanese, Simplified Chinese, and Traditional Chinese according to the device language. If the device language is in another language, then it is changed to English.

    Use the following code to use the customer inquiry feature by integrating the dashboard.

    GamePot.showCSWebView();
    

    Customer inquiry through external link

    Use the following code to allow inquiry registration by customers who are not logged in, through an external link.

    // url: External customer support URL issued by GAMEPOT
    
    GamePot.showWebView(string url);
    

    Terms and policies UI call feature

    You can call various terms and policies created in the Support menu in the dashboard.

    Use the following code to call terms and policies UI.

    • Terms and Conditions

      GamePot.showTerms();
      
    • Privacy Policy

      GamePot.showPrivacy();
      
    • Refund policy

      GamePot.showRefund();
      

    Terms and Conditions acceptance feature (including GDPR)

    By using the provided pop-up UI feature, you can collect consent for various policies and terms created in the dashboard. You can also collect consent for the GDPR policy.

    Call Agree to Terms and Conditions automatically

    If you're using GAMEPOT Unity SDK version v.3.3.0 or later, the Agree to Terms and Conditions pop-up window is automatically displayed when the user logs in.

    Use the following code to change whether to automatically call Agree to Terms and Conditions upon login.

    // Default value is true
    // The MATERIAL_BLUE theme applied upon automatic pop-up windows 
    // The Agree to Terms and Conditions pop-up window does not appear upon login when set to false.
    GamePot.setAutoAgree(true);
    
    // When applying the MATERIAL_ORANGE as custom
    NAgreeInfo bulider = new NAgreeInfo(); 
    bulider.theme = "MATERIAL_ORANGE";
    GamePot.setAutoAgreeBuilder(bulider);
    
    ...
    
    GamePot.login(NCommon.LoginType);
    
    ...
    

    Call Agree to Terms and Conditions manually

    Use the following code to manually call Agree to Terms and Conditions.

    • Select theme

      // Basic theme
      BLUE
      GREEN
      
      // Improved theme
      MATERIAL_RED,
      MATERIAL_BLUE,
      MATERIAL_CYAN,
      MATERIAL_ORANGE,
      MATERIAL_PURPLE,
      MATERIAL_DARKBLUE,
      MATERIAL_YELLOW,
      MATERIAL_GRAPE,
      MATERIAL_GRAY,
      MATERIAL_GREEN,
      MATERIAL_PEACH,
      
    • Call - Method 1

       // Default call (with MATERIAL_BLUE theme)
      GamePot.showAgreeDialog();
      
      // When applying other themes
      NAgreeInfo info = new NAgreeInfo();
      info.theme = "MATERIAL_RED";
      GamePot.showAgreeDialog(info);
      // If agreed to Terms and Conditions
      public void onAgreeDialogSuccess(NAgreeResultInfo info)
      {
          // info.agree: It is true if agreed to all required terms and conditions
          // info.agreePush: It is true if checked to agree to receive general ad push, false if not.
          // info.agreeNight: It is true if checked to agree to receive night ad push, false if not.
          // Set agreePush/agreeNight values at once through setPushStatus API after login is complete.
      }
      
      // Error triggered
      public void onAgreeDialogFailure(NError error)
      {
          // Display the message using error.message.
      }
      
    • Call - Method 2

            // Default call (with BLUE theme)
        showAgreeDialog(GamePotCallbackDelegate.CB_ShowAgree);
    
        // When applying other themes
        NAgreeInfo info = new NAgreeInfo();
        info.theme = "MATERIAL_RED";
        GamePot.showAgreeDialog(info,GamePotCallbackDelegate.CB_ShowAgree);
        
        GamePot.showAgreeDialog( info, (success, NAgreeResultInfo agreeInfo, NError error) => {
           if(success)
           {
                // If agreed to Terms and Conditions
                // info.agree: It is true if agreed to all required terms and conditions
                 // info.agreePush: It is true if checked to agree to receive general ad push, false if not.
                 // info.agreeNight: It is true if checked to agree to receive night ad push, false if not.
                 // Set agreePush/agreeNight values at once through setPushStatus API after login is complete.
           }
           else
           {
                // Error triggered
                // Display the message using error.message.
           }
        });
    

    Configure Agree to Terms and Conditions UI manually

    Rather than using the theme provided by the SDK, you can use the Agree to Terms and Conditions UI theme you configured directly.

    To configure the Agree to Terms and Conditions UI directly and use it, use the following code to configure the theme before calling Agree to Terms and Conditions.

    NAgreeInfo info = new NAgreeInfo();
    info.theme = "MATERIAL_RED";
    info.headerBackGradient = new string[] { "0xFF00050B", "0xFF0F1B21" };
    info.headerTitleColor = "0xFFFF0000";
    info.headerBottomColor = "0xFF00FF00";
    // Set to "" if not used
    info.headerTitle = "Agree to terms and conditions";
    // Android: res/drawable object ID (file name)
    // iOS: asset object ID (file name)
    info.headerIconDrawable = "ic_stat_gamepot_agree";
    
    info.contentBackGradient = new string[] { "0xFFFF2432", "0xFF11FF32" };
    info.contentIconColor = "0xFF0429FF";
    info.contentCheckColor = "0xFFFFADB5";
    info.contentTitleColor = "0xFF98FFC6";
    info.contentShowColor = "0xFF98B3FF";
    // Android: res/drawable object ID (file name)
    // iOS: asset object ID (file name)
    info.contentIconDrawable = "ic_stat_gamepot_small";
    
    info.footerBackGradient = new string[] { "0xFFFFFFFF", "0xFF112432" };
    info.footerButtonGradient = new string[] { "0xFF1E3A57", "0xFFFFFFFF" };
    info.footerButtonOutlineColor = "0xFFFF171A";
    info.footerTitleColor = "0xFFFF00D5";
    info.footerTitle = "Start game";
    
    // Whether to show the button for agreeing to receive general ad push
    info.showPush = true;
    
    // Whether to show Agree to Receive Night Ad push button
    info.showNightPush = true;
    
    // Configure the link button for agreeing to receive general ads (If not used, do not input)
    info.pushDetailURL = "https://...";
    
    // Configure the link button for agreeing to receive night ads (If not used, do not input)
    info.nightPushDetailURL = "https://...";
    
    // Change description
    info.allMessage = "Agree to all";
    info.termMessage = "Required) Terms of service";
    info.privacyMessage = "Required) Terms and conditions of the privacy policy";
    info.pushMessage = "Optional) Agree to receive general push";
    info.nightPushMessage = "Optional) Agree to receive night push";
    
    
    //Whether to display a toast message (agreed time) at game startup after agreeing to receive ad push (general/night)
    GamePot.setShowToastPushStatus(true);
    GamePot.showAgreeDialog(info);
    
    //Whether to enable options related to age restrictions in the Terms and Conditions pop-up (disabled by default; when enabled, the entry of the GAMEPOT dashboard > Support > Settings > GDPR > Email authentication field is required)
    info.ageCertificationShow = false;  // true: enable age restrictions; false: disable
    
    • Each variable applies to the area displayed in the following image.
      • AgeView
        game-gamepotandroid_ko
      • EmailView
        gamepot_unity_15_1_ko
      • AgreeView
        gamepot_unity_15_2_ko

    GDPR Terms and Conditions checklist feature

    Use the following code to import the GDPR Terms and Conditions items activated from the dashboard in the form of a list.

    //The returned data format is string[].
    GamePot.getGDPRCheckedList();
    
    //Each returned parameter applies to the following settings in the dashboard.
    gdpr_privacy: privacy policy
    gdpr_term: Terms and Conditions
    gdpr_gdpr: GDPR Terms and Conditions
    gdpr_push_normal: consent to receive event push notifications
    gdpr_push_night: consent to receive nighttime event push notifications (only applicable in Korea)
    gdpr_adapp_custom: consent to see personalized ads (for countries where GDPR is applicable)
    gdpr_adapp_nocustom: consent to see non-personalized ads (for countries where GDPR is applicable)
    

    Repayment pop-up feature for payment cancellation abusers

    If you have set to automatically ban Google payment cancellation abusers through the Payment cancellation menu in the dashboard, then you can set to display a repayment pop-up UI provided by the SDK to the abuser, and the ban will be automatically lifted when they re-pay for the canceled item via the UI.

    Use the following code to modify the text in the repayment pop-up for payment cancellation abusers.

    
    NVoidInfo info = new NVoidInfo();
    
    //Types of themes
    MATERIAL_RED,
    MATERIAL_BLUE,
    MATERIAL_CYAN,
    MATERIAL_ORANGE,
    MATERIAL_PURPLE,
    MATERIAL_DARKBLUE,
    MATERIAL_YELLOW,
    MATERIAL_GRAPE,
    MATERIAL_GRAY,
    MATERIAL_GREEN,
    MATERIAL_PEACH
    
    //Change theme
    info.theme = "MATERIAL_ORANGE";
    
    // Change description
    info.headerTitle = "Header Title Section!";
    
    info.descHTML = "descHTML Section!";
    
    info.listHeaderTitle = "listHeaderTitle Section!";
    
    info.footerTitle = "footerTitle Section!";
    
    GamePot.setVoidBuilder(info);
    

    Remote configuration feature

    You can import the server parameter values registered in the Game > Remote configuration menu in the dashboard. If you import parameter values and use them in the SDK, then you can edit and control various elements without updating the game.

    The imported parameters are loaded at login. You can call them after they have been loaded.

    Use the following code to use the remote configuration feature.

    //"test_01": Parameter string
    var str_value = GamePot.getConfig("test_01");
    
    //Import all parameters added in the dashboard in json string format.
    var json_value = GamePot.getConfigs();
    

    Game log transfer feature

    You can call game logs and check them in the Game > Player menu in the dashboard.

    To use the game log transfer feature, enter reserved words in the following code by referring to the table, and then call the code.

    • Reserved words and code
      Reserved wordsRequirement StatusTypeDescriptionMaximum length
      GamePotSendLogCharacter.NAMERequirement StatusStringCharacter name128
      GamePotSendLogCharacter.LEVELOptionalStringLevel128
      GamePotSendLogCharacter.SERVER_IDOptionalStringServer ID128
      GamePotSendLogCharacter.PLAYER_IDOptionalStringCharacter ID128
      GamePotSendLogCharacter.USERDATAOptionalStringETC128
      String name = "Character name";
      String level = "10";
      String serverid = "svn_001";
      String playerid = "283282191001";
      String userdata = "";
      
      GamePotSendLogCharacter characterLog = new GamePotSendLogCharacter();
      characterLog.put(GamePotSendLogCharacter.NAME, name);
      characterLog.put(GamePotSendLogCharacter.PLAYER_ID, playerid);
      characterLog.put(GamePotSendLogCharacter.LEVEL, level);
      characterLog.put(GamePotSendLogCharacter.SERVER_ID, serverid);
      characterLog.put(GamePotSendLogCharacter.USERDATA, userdata);
      
      Boolean result = GamePot.characterInfo(characterLog);
      
      // Result true: Validation succeeded. The logs are transferred to the GAMEPOT server.
      // Result false: Validation failed. Check the logcat.
      

    Check AppStatus

    Use the following code to check current AppStatus of the client. (Check maintenance/update status before login)

    public enum ResultCheckAppStatus
    {
        SUCCESS,
        FAILED,
        NEED_UPDATE,
        MAINTENANCE
    }
    
    GamePot.checkAppStatus((NCommon.ResultCheckAppStatus resultState , NAppStatus appStatus, NError error) =>
    {
        switch(resultState)
        {
            case NCommon.ResultCheckAppStatus.SUCCESS:
            // Status without a maintenance check/update setting
            break;
    
            case NCommon.ResultCheckAppStatus.FAILED:
            // Handling error
            break;
    
            case NCommon.ResultCheckAppStatus.NEED_UPDATE:
            // Update
            // Handling appStatus
             // You need to create and display a pop-up window based on the status information passed in a parameter. Choose between the following two methods to configure the pop-up window:
            // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
            // Case 2: Call the following code and use the SDK's own pop-up window.
            // GamePot.showAppStatusPopup(appStatus.ToJson());
            break;
    
            case NCommon.ResultCheckAppStatus.MAINTENANCE:
            // Maintenance check
            // Handling appStatus
            // You need to create and display a pop-up window based on the status information passed in a parameter. Choose between the following two methods to configure the pop-up window:
            // Case 1: Use an in-game pop-up window with its UI implemented directly by the developer.
            // Case 2: Call the following code and use the SDK's own pop-up window.
            // GamePot.showAppStatusPopup(appStatus.ToJson());
            break;
            
            default:
            break;
        }
    });
    

    Set setUserData

    Use when you want to add additional information to the member after login.
    Maximum number of keys limited to 50
    Maximum length of value limited to 1024 bytes
    The information can only be viewed in the member details.

    • Method 1
    JSONNode _json = new JSONObject();
    _json.Add("appversion", "1.0.23");
    _json.Add("server", "s1");
    string json = _json.ToString();
    GamePot.setUserData(_json);
    
    // setUserData succeeded
    public void onSetUserDataSuccess() {
    
    }
    
    // setUserData failed
    public void onSetUserDataFailure(NError error) {
    
    }
    
    • Method 2
    void setUserData(JSONNode userData, GamePotCallbackDelegate.CB_SetUserData cbSetUserData);
    
    JSONNode _json = new JSONObject();
    _json.Add("appversion", "1.0.23");
    _json.Add("server", "s1");
    string json = _json.ToString();
    
    GamePot.setUserData(_json, (success,  error) => {
        if(success)
        {
            // setUserData succeeded
        }
       else
       {
            // setUserData failed
        }
    });
    

    Integrate third party SDK

    GAMEPOT Unity SDK supports the integration with third-party SDKs.

    Integrate third party SDK login

    To use the login feature by integrating a third-party SDK, enter parameter values in the following code by referring to the table, and then use that code.

    • Parameters and code

      • Since it doesn't support auto login, it needs to be called every time.
      Parameter NameRequirement StatusTypeDescription
      useridRequirement StatusStringUser unique ID
      ":" (colons) can't be used for this value
      String userid = "memberid of 3rd party sdk";
      
      GamePot.loginByThirdPartySDK("userid");
      

    Integrate third party SDK payment

    To use the payment feature by integrating a third-party SDK, enter parameter values in the following code by referring to the table, and then use that code.

    • Parameters and code
      Parameter NameRequirement StatusTypeDescription
      productidRequirement StatusStringItem ID registered in the dashboard
      transactionidRequirement StatusStringPayment receipt number (GPA-xxx-xxxx-xxxx)
      storeRequirement StatusPayment store (google, apple, one, galaxy)
      currencyOptionalStringCurrency (KRW, USD)
      priceOptionaldoubleAmount of purchased items
      paymentidOptionalStringPayment ID
      Usually the same as store_id
      uniqueidOptionalStringUnique ID used by the developer
      String productId = "purchase_001";
      String transactionId = "GPA-xxx-xxxx-xxxx";
      String currency = "KRW";
      double price = 1200;
      String paymentId = "google";
      String uniqueId = "developer unique id";
      
      sendPurchaseByThirdPartySDK(string productId, string transactionId, string currency, double price, string store, string paymentId, string uniqueId);
      

    Precautions for integrating Firebase SDK

    To properly integrate the Firebase SDK, you need to use the Resolve process after deselecting the Patch mainTemplate.gradle option from the Assets > External Dependency Manager > Android Resolver > Settings menu whenever the package name changes including in the initial linkage.

    When the Firebase library conducts repackaging with the package name entered in the Unity editor, the app installation is not executed if the package name is incorrect. In such cases, the package name has to be edited to a correct name.

    Use the following code to check and edit the package name.

    // After resolving, make sure that the android:authorities value in the
    AndroidManifest.xml in com.google.firebase.firebase-common-[Firebase library version].aar is in the correct package name format ([Pacakge name].firebaseinitprovider) for your version.
    
    <provider>
                android:name="com.google.firebase.provider.FirebaseInitProvider"
                android:exported="false"
                android:authorities=“[App package name].firebaseinitprovider"
    

    Edit project in native environment

    If you're using the GAMEPOT Unity SDK and need to edit your project in the native environment, you need to create a MainActivity that inherits the class of the MainActivity, io.gamepot.unity.plugin.GamePotSDKActivity, and handles it separately.

    The following describes how to edit the project in the native environment using GAMEPOT Unity SDK. The descriptions are based on the Example file.

    1. Delete the example bridge file of the downloaded example project, gamepot-bridge.aar, at /app/libs.
    2. Add the gamepot-bridge.aar file of the current project to the example project's /app/libs location.
    3. Execute the build and add the created .aar file in the project's /Android/libs path.
    4. Use the following code to edit AndroidManifest.xml, as well as replace MainActivity.
      Previous:
              <activity android:theme="@style/UnityThemeSelector"
                  android:name="io.gamepot.unity.plugin.GamePotSDKActivity"
      
      Edited: 
                  android:name="io.gamepot.unity.plugin.Game.GameActivity"   //Based on example: change to an activity inherited from the build
      

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.