iOS
This article guides you through setting up LINE as an identity provider, enabling your iOS game to access Player Network authentication services.
Prerequisites
1. Set up the LINE app on LINE Developers Console
1. Create a LINE app and configure a channel
Before configuring the app for required platforms, log in to LINE Developers Console and create a developer account. With the developer account, use LINE Developers Console and create a channel (communication path between LINE functions and your app).
Create a channel
On the Console home, click Create New Provider and follow the on-screen instructions to create the provider.
In the Channels tab on the provider page, click Create a LINE Login channel.
On the new channel creation page, enter required information and click Create.
In the Basic settings tab on the channel page, check the Channel ID and other required information for Player Network SDK configuration.
Configure the channel for mobile app (Android/iOS).
In the LINE Login tab on the channel page, enable Mobile app and enter required information.
To add a new channel package name and corresponding signature to support a multi-store channel package, add a new line to enter the information.
Click Update to save the configuration.
2. Add user permissions
Immediately after creating a channel, the channel is set to Developing mode. Only channel admin and testers have access to LINE login functions.
Add a tester
Log in to LINE Developers Console.
Select the corresponding channel from the most recently visited channels on the homepage.
On the channel page, click Roles.
In the Roles tab, click Invite by email.
Add testers in the Invite new members section.
Email: LINE account of the tester
Role: TesterClick Send Invitations to send tester invitations.
Wait for the testers to accept the email invitation.
- Create an account for Player Network Console.
- Create a new project for your game, or join an existing one.
- Download the SDK.
- Integrate the SDK.
- Add LINE as an authentication method for your project on Player Network Console.
Step 1: Configure the SDK for LINE login
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 theGAME_ID
andSDK_KEY
assigned by Player Network Console. - Set
LOG_LEVEL = 1
,LOG_CONSOLE_OUTPUT_ENABLE = 1
,LOG_FILE_OUTPUT_ENABLE = 1
,LOG_ENCRYPT_ENABLE = 0
, andLOG_COMPRESS_ENABLE = 0
to output console logs and log files without encrypting or compressing the output. - Replace
{INTL_LINE_CHANNEL_ID}
with the Channel ID registered on LINE Developers.
- Set the SDK backend environment to
Add LINE to the
Info.plist
file.noteAs LINE stopped maintaining the Objective-C version of the SDK, and all the later SDKs are Swift versions, the current integration is with the Swift version.
Swift-LINESDK only supports Xcode10.3 and higher.
For more information, see Adapt to Swift SDK
- Unity
- Unreal Engine
Check the predefined values in
INTLLINEKit.projmods
and replace{INTL_BUNDLE_ID}
with theBundleIdentifier
(similar tocom.example.demo
) configured on LINE before exporting the Xcode project from Unity.{
"group": "INTL",
"libs": [],
"frameworks": [],
"files": [],
"folders": [],
"excludes": [],
"headerpaths":[],
"build_settings": {},
"system_capabilities": {},
"Info.plist":{
"LSApplicationQueriesSchemes":
[
"lineauth2",
"line"
],
"CFBundleURLTypes" :
[
{
"CFBundleTypeRole":"Editor",
"CFBundleURLSchemes":"line3rdp.{INTL_BUNDLE_ID}"
}
]
}
}- Player Network SDK 1.18 or later
- Before Player Network SDK 1.18
Open and modify the file that corresponds to your SDK version:
- For V1.24 or later:
INTLSDK/Source/INTLLINE/Libs/iOS/INTLLINE_UPL.xml
- For V1.18 to V1.23:
INTLSDK/Source/INTLConfig/Configs/iOS/Plist/INTLLINE.plist
<key>CFBundleURLSchemes</key>
<array>
<string>line3rdp.{INTL_BUNDLE_ID}</string>
</array>Go to Unreal Engine > Settings > Project Settings > Platforms > iOS > Extra Plist Data to add SDK to the PLIST file.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>LINE</string>
<key>CFBundleURLSchemes</key>
<array>
<string>line3rdp.{INTL_BUNDLE_ID}</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>line</string>
<string>lineauth2</string>
</array>Replace
{INTL_BUNDLE_ID}
with the game engine'sBundleIdentifier
that is similar tocom.example.demo
(needs to be identical with theBundleIdentifier
configured on the LINE developer platform).For more information, see LINE Developer Portal Bundle ID.
Step 2: Add LINE login
LINE does not require an app installation before login.
- If users have installed and logged in to the LINE app on an iOS device, the app will open for login. Otherwise, a web page will open.
- Whether users log in through the LINE app or a webpage on an iOS device, a webpage prompt will appear for them to open the game client. If the prompt is rejected, the game client will not open and cannot receive callbacks.
- LINE login authorization requires access to both the OpenID and profile of a player. The former is used to obtain a player's LINE OpenID, while the latter is used to obtain the player's LINE access token, which can be configured through the
Permissions
field. If thePermissions
field is empty, access to OpenID and profile is used by default for Player Network SDK when users log in to LINE.
Add an observer to handle authentication callbacks.
- Unity
- Unreal Engine
// 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";
}
}C++ Event Handling (above v1.15)
//configure callback
FINTLAuthEvent authEvent;
authEvent.AddUObject(this, &OnAuthResult_Implementation);
UINTLSDKAPI::SetAuthResultObserver(authEvent);
// Remove callbacks
UINTLSDKAPI::GetAuthResultObserver().Clear();void OnAuthResult_Implementation(FINTLAuthResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}Unreal Event Handling
void OnAuthResult_Implementation(FINTLAuthResult ret)
{
UE_LOG(LogTemp, Warning, TEXT("MethodID: %d"), ret.MethodId);
}Call the
AutoLogin
method.- Unity
- Unreal Engine
INTLAPI.AutoLogin();
UINTLSDKAPI::AutoLogin();
Call the
Login
method to ask for user input if auto-login fails.- Unity
- Unreal Engine
INTLAPI.Login(INTLChannel.LINE);
UINTLSDKAPI::Login(EINTLLoginChannel::kChannelLINE);
Sync client authentication state with the game's backend and wait for the final authentication result.
Step 3: Test the login function
Search for the keyword "AuthResult" in the Player Network SDK logs to verify if the correct channel name and OpenID are returned. If they are, it indicates a successful configuration and the login function has been added successfully.
Step 4: Release the game
To open LINE Login function to the players, set the channel to Published.