Login via Line
Add dependencies
- Android
- iOS
- Unity
- Unreal
Add the following code in build.gradle on the app-level, and replace $msdk_version with the actual MSDK version.
dependencies {
implementation "com.garena.sdk.android:login-line:$msdk_version"
}
Configuration
- Android
- iOS
- Unity
- Unreal
Configure AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
...
<application ...>
<meta-data
android:name="com.garena.sdk.line.channelId"
android:value="[line_channel_id]" />
....
</application>
</manifest>
Configure Info.plist
<key>LineSDKConfig</key>
<dict>
<key>ChannelID</key>
<string>9999999</string>
</dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<!-- Specify URL scheme to use when returning from LINE to your app. -->
<string>line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<!-- Specify URL scheme to use when launching LINE from your app. -->
<string>lineauth2</string>
</array>
Configure line_channel_id in Window -> GMSDK Settings
Configure LineChannelId in Edit -> Project Settings -> Plugins -> Garena MSDK
Usage
- Android
- iOS
- Unity
- Unreal
AccountManager accountManager = new AccountManager(activity);
accountManager.login(PlatformType.LINE, onLoginListener);
[MSDKLoginManager loginWithPlatform:MSDKePlatformLine completion:^(MSDKLoginRet *loginRet) {
// handle login result
}];
GMSDKHandler.LoginClient.Login(AccountPlatform.Line, OnLoginCallback);
UMsdkLogin::Login(Line);