我已成功从myapp登录到facebook并获得了accessstoken,但当我在墙上发布消息时,我遇到以下异常。
{"error":{"message":"(#10) Application does not have permission for this action","type":"OAuthException","code":10}}
代码是:
Bundle parameters = new Bundle();
parameters.putString("message", "hello ...");
parameters.putString(Facebook.TOKEN, mFacebook.getAccessToken());
try {
String response = mFacebook.request("me/feed", parameters,"POST");
} catch (IOException e)
{}
答案 0 :(得分:0)
请从您自己的应用程序中获得publish_stream权限。
private static final String[] PERMISSIONS =
new String[] {"publish_stream", "read_stream",};
当您初始化登录按钮时,您需要传递权限。
mLoginButton.init(this, mFacebook,PERMISSIONS);