LinkedIn

Contents

A Cordova plugin that lets you use LinkedIn Native SDKs for Android and iOS.

https://github.com/zyra/cordova-plugin-linkedin

Ionic LinkedIn插件的安装(Installation)

ionic cordova plugin add cordova-plugin-linkedin npm install @ionic-native/linkedin

Ionic LinkedIn插件支持的平台(Supported Platforms)

  • Android
  • iOS

Ionic LinkedIn插件的用法(Usage)

import { LinkedIn } from '@ionic-native/linkedin';

constructor(private linkedin: LinkedIn) { }

...

// check if there is an active session
this.linkedin.hasActiveSession().then((active) => console.log('has active session?', active));

// login
const scopes = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];
this.linkedin.login(scopes, true)
  .then(() => console.log('Logged in!'))
  .catch(e => console.log('Error logging in', e));


// get connections
this.linkedin.getRequest('people/~')
  .then(res => console.log(res))
  .catch(e => console.log(e));

// share something on profile
const body = {
  comment: 'Hello world!',
  visibility: {
    code: 'anyone'
  }
};

this.linkedin.postRequest('~/shares', body)
  .then(res => console.log(res))
  .catch(e => console.log(e));