Skip to main content

iOS

The purpose of this article is to explain how to set up TikTok authentication so that your project can be logged 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 login to TikTok Developer account

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

2. (Optional) Create a company Organization

TikTok recommends creating an organization to facilitate future collaboration and role/permission management.

  1. Organization description
  2. Create organization entry
3. Create TikTok App
  1. Go to Apps, and click Connect an app. Image: TikTok - connect an app
  2. Choose Individual Developer or Company Organization.
  3. Enter the App name and click Confirm to finish creation. Image: TikTok - confirm app
4. Configure App Basic Information
  1. Fill in basic app information: icon, name, app type, description, Terms of Service, Privacy Policy.
  2. In Platforms, check iOS. Image: TikTok - choose ios platform
  3. In Configure for iOS, provide iOS package details (ask your developer teammate). Image: TikTok - configure for ios platform
5. Terms of Service & Privacy Policy URL domain authentication

TikTok requires authentication of the domain for your ToS/Privacy Policy URL; only after verification can you save and submit for review.

  1. Click Verify URL properties. Image: TikTok - verify url properties
  2. In the pop-up, click Verify properties. Image: TikTok - verify properties
  3. Select 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 your operations/website teammate to upload this file to the corresponding domain server, making sure 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 it fails: Check whether the signature file can be downloaded normally in the browser (file path/permissions/CDN cache, etc.).
6. App review information
  1. Describe in detail how your project uses the TikTok Login Kit authentication feature.
  2. Record a complete video of your project using TikTok authorized login. Since TikTok integration may not be complete at this stage, you can temporarily upload any video and provide the correct one when submitting for review. Image: TikTok - review app
7. Configure Products: enable Login Kit
  1. Go to Products and click Add products. Image: TikTok - add products
  2. Click + Add to add Login Kit. Image: TikTok - login kit
  3. Configure the Login Kit:
    • iOS Universal Link (ask your developer teammate) Image: TikTok - iOS 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 Login Kit is added, TikTok automatically adds the user.info.basic permission.
  • Usually, no extra Scopes are needed (unless clearly required by business needs).
9. Save App configuration
  1. In the top right corner, click Save to save the configuration.
  2. Since integration and joint debugging have not been completed, please do not click “Submit for review” for now.
  3. If saving fails, please fill in all required fields according to the page error prompt (almost all of the above steps are necessary). Image: TikTok - submit for review
10. (Recommended) Create Sandbox and add test users

Before submitting for review, it is recommended to conduct development integration in the Sandbox environment.

  1. Switch to Sandbox in the top left corner, and click Create Sandbox. Image: TikTok - create sandbox name Image: TikTok - open sandbox
  2. Enter a 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 a test TikTok account: Image: TikTok - add tiktok account sandbox
    • After successfully logging in, the account will appear in the Target Users list.
    • Only accounts in Target Users can perform TikTok login tests Image: TikTok - sandbox login Image: TikTok - sandbox target users
  1. Get Player Network Console login account.
  2. Create a new project for your project 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 the current app in the TikTok Developer Platform, which identifies your project in the TikTok login process.
    • Replace {INTL_TIKTOK_REDIRECT_URI} with the Redirect URI (Deeplink address) where TikTok will redirect after the authorization is complete, so the user returns to the project with login results.

Step 2: Add TikTok Login

Player Network checks the application login status before opening the app for login.

  • If the TikTok app is installed, Player Network will open the TikTok app for login.
  • If the TikTok app is not installed, the Player Network login page will not display the TikTok channel login option.
  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. Call the AutoLogin interface to log in automatically.
INTLAPI.AutoLogin();
  1. If automatic login fails, call the Login interface to allow players 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.