Skip to content
This repository was archived by the owner on Mar 14, 2019. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed authored Mar 17, 2017
1 parent 2e09892 commit 2bcb3b6
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ Makes a POST request to LinkedIn REST API. You can view the possible paths [here

### openProfile
```js
openProfile(memberId)
openProfile(memberId, success, error)
```
* **memberId**: Member Id of the user
Opens a member's profile in the LinkedIn app.

### hasActiveSession
```js
hasActiveSession()
hasActiveSession(success, error)
```
Function returning true if an active session is found, false otherwise. Should be used to avoid unnecessary login
Checks if there is already an existing active session. This should be used to avoid unecessary login.

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


## Example
Expand Down Expand Up @@ -85,4 +87,14 @@ cordova.plugins.LinkedIn.login(scopes, true, function() {

}, onError);


// check for existing session
cordova.plugin.LinkedIn.hasActiveSession(function(exists) {
if (exists) {
console.log('We have an active session');
} else {
console.log('There is no active session, we need to call the login method');
}
});

```

0 comments on commit 2bcb3b6

Please sign in to comment.