LineLogin
LINE Login, driven from shared code.
// once, at startup
LineLogin.configure(LineLoginConfig(channelId = "1234567890"))
// wherever the user taps "Sign in with LINE"
when (val result = LineLogin.login()) {
is LineLoginResult.Success -> println(result.profile?.displayName)
LineLoginResult.Cancelled -> Unit
is LineLoginResult.Failure -> println(result.message)
}Underneath, this is LINE's own Android SDK on Android and LINE's own iOS SDK on iOS — the same app-to-app login, the same browser fallback, the same token storage. Only the API is shared.
Why an object
Not a design preference: LoginManager on iOS is a process-wide singleton whose setup is one-shot and asserts if called twice. An API that let you construct several clients would be lying about what the platform can do.
Properties
True once configure has run successfully.
Functions
Prepares the LINE SDK. Call once, as early as possible — App.onCreate and your iOS app's initialiser are both fine, and so is any shared startup code that runs before the first login.
Configures LINE Login with an explicit Context.
The access token this device currently holds, or null if there is none.
Whether the LINE app is installed on this device.
Whether the LINE app is installed on this device, asked with an explicit Context.
Whether this device holds a token at all.
Signs the user in, suspending until they finish, cancel, or the attempt fails.
Signs the user out: clears the credentials this device holds and revokes the token with LINE.
The login LINE completed while your app was not running, or null when there is none.