Skip to main content

iOS

The purpose of this article is to explain how to set up LINE authentication so that your game can be logged in through the LINE channel using the Player Network Login Authentication Service.

Prerequisites

1. Setting up the LINE application on the LINE Developers Console

1. Create LINE application and configure channels

Before configuring the application for the desired platform, log in to the LINE Developers Console and create a developer account.With your developer account, use the LINE Developers Console and create a channel (a communication channel between LINE features and your application).

Create a channel
  1. On the Console home page, click Create New Provider and follow the on-screen instructions to create the provider.

    Image: Create a LINE Provider

  2. On the Channels tab of the Providers page, click Create a LINE Login channel.

  3. On the New Channel Creation page, enter the required information and click Create.

  4. In the Basic settings tab of the Channel page, check Channel ID and other information required for Player Network SDK configuration.

    Image:Add LINE app information

  5. Configure channels for mobile apps (Android/iOS).

    In the LINE Login tab on the Channels page, enable Mobile app and enter the required information.

    Image: LINE Login settings

    To add a new channel pack name and corresponding signature to support multi-store channel packs, add a new line input message.

    Image: Multiple package name in LINE console

  6. Click Update to save the configuration.

2. Adding user rights

Immediately after creating a channel, the channel is set to Developing mode.Only channel administrators and testers can use the LINE login feature.

Adding Testers
  1. Log in to the LINE Developers Console.

  2. Select the appropriate channel from the recently visited channels on the home page.

    Image:Select LINE channel

  3. On the Channels page, click Roles.

  4. In the Roles tab, click Invite by email.

    Image: LINE permission configuration

  5. Add testers in the Invite new members section.
    Email:Tester's LINE account
    Role: Tester

    Image:Add LINE tester

  6. Click Send Invitations to send tester invitations.

  7. Waiting for testers to accept email invitations.

  1. Obtain 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 LINE as the login authentication method for the service in the Player Network console.

Step 1:Configure SDK for LINE Login

caution

The LINE SDK is only compatible with iOS 13.0 and higher.

  1. Open the INTLConfig.ini file.

    INTLConfig.ini
    [INTL environment]
    # WARNING: You should change this URL to the production environment when you release your game.
    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

    [LINE]
    LINE_CHANNEL_ID = {INTL_LINE_CHANNEL_ID}
    • Set the SDK backend environment to INTL_URL = https://test.intlgame.com.
    • Replace {INTL_GAME_ID} and {INTL_SDK_KEY} with the values of GAME_ID and SDK_KEY assigned by the 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 logs and log files without encrypting or compressing the output without encrypting or compressing the output.
    • Replace {INTL_LINE_CHANNEL_ID} with the Channel ID registered on LINE Developers.
  2. Adding LINE Configuration

Open the INTLLINEKit.projmods file and replace {INTL_BUNDLE_ID} with the application's Bundle Identifier before exporting the Xcode project from Unity (similar to com.example.demo).

"CFBundleURLTypes": [
{
"CFBundleTypeRole": "Editor",
"CFBundleURLSchemes": [
"line3rdp.{INTL_BUNDLE_ID}"
]
}
]

Step 2:Add LINE Login

LINE does not require an application to be installed before logging in.

  • iOS pulls up the LINE app to sign in if the LINE app is installed and signed in, and pulls up the web page to sign in if the LINE app is not installed or if the LINE app is not signed in.
  • For iOS, no matter it is LINE app authorization or logging in through web page, the web page will be pulled up after the account is successfully logged in, prompting whether to pull up the game client or not, at this time, if you click on reject, it will not pull up the game client, and the game client will not be able to receive the callbacks.
  • Authorized login to LINE requires OpenID and profile permissions.The former is to get the player's LINE OpenID and the latter is to get the player's LINE access token, which can be set via the Permissions field.If the Permissions field is empty for a business, the Player Network SDK will use the OpenID and profile permissions by default when logging into LINE.
  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 let the player log in manually.
INTLAPI.Login(INTLChannel.LINE); 
  1. Synchronize client authentication status with the game backend and wait for the final verification result.

Step 3: Acceptance testing for login functionality

Search for the keyword "AuthResult" in the Player Network SDK logs to confirm whether the channel name and OpenID are returned correctly.If correct, it means the integration configuration is successful, and login functionality has been successfully added.

If you encounter problems during the integration process, please refer to Frequently Asked Questions.

Step 4:Publish the game

To enable LINE login for players, set the channel to Published.

Image:Release game