我正在编写与 facebook 集成的应用程序。我想在没有帖子对话框的情况下发布到墙上。我尝试使用此答案中的代码,但出现错误
{"error":
{"message":"An active access token must be used to query information about the current user.",
"type":"OAuthException",
"code":2500
}
}
我使用此代码登录用户
public void authorize() {
mFacebook.authorize(mActivity, new String[] { "publish_stream" }, new DialogListener() {
@Override
public void onComplete(Bundle values) {
SharedPreferences.Editor editor = mPrefs.edit();
editor.putString("access_token", mFacebook.getAccessToken());
editor.putLong("access_expires", mFacebook.getAccessExpires());
editor.commit();
mLoginStateView.setImageResource(mAuthorizedDrawableRes);
}
@Override
public void onFacebookError(FacebookError error) {}
@Override
public void onError(DialogError e) {}
@Override
public void onCancel() {}
});
}
请解释一下我做错了什么?
[添加]
如果我尝试使用mFacebook.dialog(currentActivity, "stream.publish", params, new UpdateStatusListener());
它发布。请帮我!