Error on sharing the content to LinkedIn

China☆狼群 提交于 2019-12-06 06:43:21

Finally I have figured out what i have missed. My code was

private static Scope buildScope() {
    return Scope.build(Scope.R_BASICPROFILE, Scope.R_EMAILADDRESS);
}

So changed to

private static Scope buildScope() {
    return Scope.build(Scope.R_BASICPROFILE, Scope.R_EMAILADDRESS, Scope.W_SHARE);
}

So now its working very fine !!

When you initialize your LISessionManager, you pass it a set of OAuth scopes that you want it to use for the connection. In your sample code above, this happens via the buildScope() method that you did not include in your original question, so I can't really know for sure ... but I suspect that even though you have your LinkedIn app configured to request the w_share member permission, you are not doing the same in the buildScope() process, which will trump whatever values you set as defaults in your app's config.

Ensure your buildScope() method contains the static value for the w_share member permission, e.g.:

private static Scope buildScope() {
    return Scope.build(Scope.W_SHARE);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!