Usage

login

login(scopes, promptToInstall, success, error)

scopes: Scopes to authenticate with

promptToInstall: If set to true, the user will be prompted to install the LinkedIn app if it's not already installed
Logs the user in with selected scopes. Available scopes are: r_basicprofile, r_emailaddress, rw_company_admin and w_share.

logout

logout()

A synchronous method that clears the existing session.

getRequest

getRequest(path, success, error)

path: The request path
Makes a GET request to LinkedIn REST API. You can view the possible paths here.

postRequest

postRequest(path, body, success, error)

path: The request path

body: The reqeust body
Makes a POST request to LinkedIn REST API. You can view the possible paths here.

openProfile

openProfile(memberId, success, error)

memberId: Member Id of the user
Opens a member's profile in the LinkedIn app.

hasActiveSession

hasActiveSession(success, error)

- - - DEPRECATED - - -
This method is deprecated and will be removed in the next major release. Please use getActiveSession instead.

Checks if there is already an existing active session. This should be used to avoid unnecessary login.

The success callback function will be called with one argument as a boolean, indicating whether there is an active session.

getActiveSession

getActiveSession(success, error)

Checks if there is an existing active session.

The success callback function will be called with an object containing the access token and expiry date (if they exist).