Ionic Framework 4 is almost here. Preview the beta docs and try it out now! Try Ionic 4 Beta

Line Login

Improve this doc

The function login, logs out, acquires, verifies, and refreshes the access token. The version of LineSDK you are using is as follows.

Repo: https://github.com/nrikiji/cordova-line-login-plugin

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add https://github.com/nrikiji/cordova-line-login-plugin.git --variable LINE_CHANNEL_ID="your_line_channel_id"
    $ npm install --save @ionic-native/line-login
    
  2. Add this plugin to your app's module

Supported platforms

Usage

import { LineLogin } from '@ionic-native/line-login';


constructor(private lineLogin: LineLogin) { }

...


this.lineLogin.initialize({ channel_id: "xxxxxxxxxx" })

this.lineLogin.login()
  .then(result => console.log(result))
  .catch(error => console.log(error))

Instance Members

initialize(param)

Initialize

Param Type Details
param

LineLoginParams

Returns: Promise<any>

login()

Login

Returns: Promise<LineLoginProfile>

loginWeb()

Login with Web (iOS only)

Returns: Promise<LineLoginProfile>

logout()

Logout

Returns: Promise<any>

getAccessToken()

Get Access Token

Returns: Promise<LineLoginAccessToken>

verifyAccessToken()

Verify AccessToken

Returns: Promise<any>

refreshAccessToken()

Refresh Access Token

Returns: Promise<any>

LineLoginParams

Param Type Details
channel_id string

Line Channel ID

LineLoginProfile

Param Type Details
userID string

Line User ID

pictureURL string

Line Profile Image URL

displayName string

Line Profile Name

LineLoginAccessToken

Param Type Details
accessToken string

Line Access Token

expireTime string

Line Access Token Expire Time

API

Native

General