问题描述
首先,我的问题是,我不能发表任何网络更新,发布股份或ID邀请。我总是得到以下异常:
First, my problem is that I can't post any Network Updates, post Shares or Invite by ID. I always get the following exception :
08-29 17:18:04.000: E/AndroidRuntime(4316): FATAL EXCEPTION: main
08-29 17:18:04.000: E/AndroidRuntime(4316): com.google.code.linkedinapi.client.LinkedInApiClientException: Access to posting network updates denied.
08-29 17:18:04.000: E/AndroidRuntime(4316): at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.createLinkedInApiClientException(BaseLinkedInApiClient.java:3906)
08-29 17:18:04.000: E/AndroidRuntime(4316): at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.callApiMethod(BaseLinkedInApiClient.java:3846)
08-29 17:18:04.000: E/AndroidRuntime(4316): at com.google.code.linkedinapi.client.impl.BaseLinkedInApiClient.postNetworkUpdate(BaseLinkedInApiClient.java:1172)
08-29 17:18:04.000: E/AndroidRuntime(4316): at pl.osadkowski.LITest.LITestActivity.onNewIntent(LITestActivity.java:61)
08-29 17:18:04.000: E/AndroidRuntime(4316): at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1123)
08-29 17:18:04.000: E/AndroidRuntime(4316): at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2042)
08-29 17:18:04.000: E/AndroidRuntime(4316): at android.app.ActivityThread.performNewIntents(ActivityThread.java:2055)
08-29 17:18:04.000: E/AndroidRuntime(4316): at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2064)
08-29 17:18:04.000: E/AndroidRuntime(4316): at android.app.ActivityThread.access$1400(ActivityThread.java:123)
08-29 17:18:04.000: E/AndroidRuntime(4316): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1194)
08-29 17:18:04.000: E/AndroidRuntime(4316): at android.os.Handler.dispatchMessage(Handler.java:99)
08-29 17:18:04.000: E/AndroidRuntime(4316): at android.os.Looper.loop(Looper.java:137)
08-29 17:18:04.000: E/AndroidRuntime(4316): at android.app.ActivityThread.main(ActivityThread.java:4424)
08-29 17:18:04.000: E/AndroidRuntime(4316): at java.lang.reflect.Method.invokeNative(Native Method)
08-29 17:18:04.000: E/AndroidRuntime(4316): at java.lang.reflect.Method.invoke(Method.java:511)
08-29 17:18:04.000: E/AndroidRuntime(4316): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-29 17:18:04.000: E/AndroidRuntime(4316): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-29 17:18:04.000: E/AndroidRuntime(4316): at dalvik.system.NativeStart.main(Native Method)
其次,我有什么企图?好吧,我敢肯定,我没有尝试过一切,否则它会工作,但我觉得我用尽了所有的可能性。有些我都试过没有用的事情:
Secondly, What have I tried? Well, I'm sure I haven't tried EVERYTHING or else it would be working but I feel like I exhausted all possibilities.SOME of the things I have tried to no avail :
https://developer.linkedin.com/documents/authentication#granting
http://stackoverflow.com/a/10872824/1436210
<一个href="http://$c$c.google.com/p/linkedin-j/source/browse/trunk/linkedin-j/core/src/examples/java/com/google/$c$c/linkedinapi/client/examples/PostNetworkUpdateExample.java?r=197">http://$c$c.google.com/p/linkedin-j/source/browse/trunk/linkedin-j/core/src/examples/java/com/google/$c$c/linkedinapi/client/examples/PostNetworkUpdateExample.java?r=197
<一个href="http://$c$c.google.com/p/linkedin-j/wiki/GettingStarted">http://$c$c.google.com/p/linkedin-j/wiki/GettingStarted
<一个href="http://$c$c.google.com/p/linkedin-j/wiki/AndroidConfiguration">http://$c$c.google.com/p/linkedin-j/wiki/AndroidConfiguration
我真的希望有人能够帮助!我会尝试任何事情!万分感谢!
I really hope someone can help!! I'll try anything!!Thanks a million!
推荐答案
我为范围,参数修正,以LinkedIn-J-的android.jar的1.0.429版本
I made a fix for scope parameter to linkedin-j-android.jar of version 1.0.429
这里是链接下载修补LinkedIn-J-的android.jar作用域修复
here is the link for downloading patched linkedin-j-android.jar with scope fix
和使用情况是这样的是额外的参数
and Usage is like this it is additional parameter
private String CONSUMER_KEY="XX"; // your consumer key here
private String CONSUMER_SECRET="YY"; // your consumer secret here
private String scopeParams="rw_nus+r_basicprofile";
LinkedInOAuthService oAuthService=LinkedInOAuthServiceFactory
.getInstance().createLinkedInOAuthService(
CONSUMER_KEY,CONSUMER_SECRET, scopeParams);
希望这有助于..
Hope this helps..
这篇关于不能使用LinkedIn-J在LinkedIn上张贴任何的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!