I am using this tutorial.
My code is:
linkedInSignup() {
console.log("linked in login....");
// check if there is an active session
this.linkedin.hasActiveSession().then((active) => {
console.log('has active session?', active);
if(active === false) {
// login
let scopes:any = ['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));
}
});
}
已安装插件:
$ ionic cordova plugin add cordova-plugin-linkedin --variable APP_ID=YOUR_APP_ID
$ npm install --save @ionic-native/linkedin
没有出现任何错误,但是甚至无法使用领英登录。
您能帮助我解决这个问题吗?谢谢。