Skip to main content

Android

The purpose of this article is to explain how to set up TikTok authentication so that your Project can log in through the TikTok Channel using the Player Network login authentication Service.

Prerequisites

1. Configuring the application on the TikTok Developer Platform
1. Register and log in to the TikTok Developer Account

Use email to register and log in at the TikTok Developer Platform.

2. (Optional) Create Company Organization

TikTok recommends creating an organization for easier collaboration and role permission management.

  1. Organization documentation
  2. Create organization entry
3. Create TikTok App
  1. Open Apps and click Connect an app. Image: TikTok - connect an app
  2. Select Individual Developer or Company Organization.
  3. Enter App name, and click Confirm to complete creation. Image: TikTok - confirm app
4. Configure App Basic Information
  1. Fill in the application basic information: icon, name, app type, description, terms of service, privacy policy.
  2. Check Android under Platforms. Image: TikTok - choose android platform
  3. Under Configure for Android, enter Android package-related information (provided by development team). Image: TikTok - configure for android platform
5. Terms of Service & Privacy Policy URL Domain Authentication

TikTok requires authentication of the domain for your ToS/privacy policy URLs. You must pass this verification to save and submit for review.

  1. Click Verify URL properties. Image: TikTok - verify url properties
  2. In the popup, click Verify properties. Image: TikTok - verify properties
  3. Choose URL prefix, enter the domain URL, and click Verify. Image: TikTok - url prefix
  4. Download the signature file generated by TikTok (e.g., tiktokxxxx.txt). Image: TikTok - signature file
  5. Contact operations/website team to upload this file to the corresponding domain server so it can be directly downloaded via browser.
  6. After uploading, return to the TikTok page and click Verify to complete final authentication.
    Image: TikTok - verify
    • If failed: please check whether the signature file can be downloaded in the browser (path/permission/CDN cache, etc.).
6. App Review Information
  1. Describe in detail how the project uses the TikTok Login Kit login feature.
  2. Record a complete video showing TikTok authentication login in the project. If TikTok integration is not yet complete, you may upload any video for now and replace it when submitting for review later. Image: TikTok - review app
7. Configure Products: Enable Login Kit
  1. Go to Products, click Add products. Image: TikTok - add products
  2. Click + Add to add Login Kit. Image: TikTok - login kit
  3. Configure for Login Kit:
    • Android App Link (provided by development team) Image: TikTok - android app link
  4. Replace the link with your project's Deep Link, but keep the callback path suffix: .../pnt/tiktok/logincallback
8. Scopes Configuration
  • After adding Login Kit, TikTok will automatically include the user.info.basic permission.
  • Usually, there is no need to add extra scopes unless explicitly required by business needs.
9. Save App Configuration
  1. Click the top right Save to save configuration.
  2. As integration and debugging are not completed yet, do not click “Submit for review” for now.
  3. If saving fails, please complete any required fields indicated by error messages. (All previous steps are generally required.) Image: TikTok - submit for review
10. (Recommended) Create Sandbox and Add Test Users

It is recommended to conduct development and debugging in the Sandbox environment before submitting for review.

  1. Switch to Sandbox in the top left corner, click Create Sandbox. Image: TikTok - create sandbox name Image: TikTok - open sandbox
  2. Enter the Sandbox name, check Clone from Production or an existing Sandbox, and click Confirm. Image: TikTok - create sandbox
  3. In Sandbox, click Add account to add test TikTok account: Image: TikTok - add tiktok account sandbox
    • After login, the account will appear in the Target Users list.
    • Only accounts in Target Users can participate in TikTok login testing Image: TikTok - sandbox login Image: TikTok - sandbox target users
  1. Get Player Network Console login account.
  2. Create a new project for your game or join an existing one.
  3. Download SDK.
  4. Integrate SDK.
  5. Add TikTok as the login authentication method for business in Player Network Console.

Step 1: Configure SDK for TikTok Login

  1. Open the project INTLConfig.ini file:

    INTLConfig.ini
    [INTL environment]
    # WARNING: You should change this URL to the production environment when you release your project.
    INTL_URL = https://test.intlgame.com
    GAME_ID = {INTL_GAME_ID}
    SDK_KEY = {INTL_SDK_KEY}
    [INTL Log]
    LOG_LEVEL = 1
    LOG_CONSOLE_OUTPUT_ENABLE = 1
    LOG_FILE_OUTPUT_ENABLE = 1
    LOG_ENCRYPT_ENABLE = 0
    LOG_COMPRESS_ENABLE = 0
    [TikTok]
    TIKTOK_CLIENT_KEY = {INTL_TIKTOK_CLIENT_KEY}
    TIKTOK_REDIRECT_URI = {INTL_TIKTOK_REDIRECT_URI}
    • Set the SDK backend environment INTL_URL to https://test.intlgame.com.
    • Replace {INTL_GAME_ID} and {INTL_SDK_KEY} with the GAME_ID and SDK_KEY values assigned by Player Network Console.
    • Set LOG_LEVEL = 1, LOG_CONSOLE_OUTPUT_ENABLE = 1, LOG_FILE_OUTPUT_ENABLE = 1, LOG_ENCRYPT_ENABLE = 0, and LOG_COMPRESS_ENABLE = 0 to output console and log files without encryption or compression.
    • Replace {INTL_TIKTOK_CLIENT_KEY} with the Client Key assigned for this application by TikTok Developer Platform, used to identify the project during the TikTok login flow.
    • Replace {INTL_TIKTOK_REDIRECT_URI} with the Redirect URI (Deep Link address) where TikTok will callback to your project after authorization, passing back the login result.

Step 2: Add TikTok Login

Player Network checks the application login status before starting the login process.

  • If the TikTok application is installed, Player Network opens the TikTok application for login.
  • If the TikTok application is not installed, the Player Network login page will not display the TikTok channel login entry.
  1. Register login-related callbacks.
// Add callbacks
public void AddAuthObserver()
{
INTLAPI.AddAuthResultObserver(OnAuthResultEvent);
}

// Remove callbacks
public void RemoveAuthObserver()
{
INTLAPI.RemoveAuthResultObserver(OnAuthResultEvent);
}

// Process the INTLAuthResult callback
public void OnAuthResultEvent(INTLAuthResult ret)
{
Debug.Log($"MethodID: {ret.MethodId}");

string methodTag = "";
if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_LOGIN)
{
methodTag = "Login";
}
else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_BIND)
{
methodTag = "Bind";
}
else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_AUTOLOGIN)
{
methodTag = "AutoLogin";
}
else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_QUERY_USER_INFO)
{
methodTag = "QueryUserInfo";
}
else if (authRet.MethodId == (int)INTLMethodID.INTL_AUTH_GET_AUTH_RESULT)
{
methodTag = "GetAuthResult";
}
}
  1. Invoke the AutoLogin interface to log in automatically.
INTLAPI.AutoLogin();
  1. If automatic login fails, call the Login interface to allow the player to manually log in.
INTLAPI.Login(INTLChannel.TikTok); 
  1. Synchronize the client's authentication status with the project backend and await the final validation result.

If you encounter issues during integration, see FAQs.