我有这段代码:
public class LikeFbPostAsyncTask extends AsyncTask<String, Void, Void> {
ImageButton mLockImage;
Response fbServerResponse;
public LikeFbPostAsyncTask(ImageButton lockImage) {
mLockImage = lockImage;
}
@Override
protected void onPreExecute() {
Log.i("LikeFbPostAsyncTask", "Starting web task...");
}
@Override
protected Void doInBackground(String... fbPostId) {
Request likeRequest = new Request(Session.getActiveSession(),
fbPostId[0] + "/likes", null, HttpMethod.POST,
new Request.Callback() {
// here is non-ui thread
@Override
public void onCompleted(final Response response) {
Log.i(TAG, response.toString());
fbServerResponse = response;
}
});
Request.executeBatchAndWait(likeRequest);
return null;
}
}
提交FB之类的。
这是对FB服务器的请求:
{Request: session: {Session state:OPENED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[email, user_birthday, user_location, user_likes, user_interests, user_friends, user_status, basic_info]}, appId:1313----0364547}, graphPath: 685560152_10153987123125153/likes, graphObject: null, restMethod: null, httpMethod: POST, parameters: Bundle[{migration_bundle=fbsdk:20131203}]}
我收到以下错误:
errorMessage: (#200) You do not have sufficient permissions to perform this action
我如何获得足够的许可?
更新 我试过@serge解决方案
并在应用中心权限下将&#34; users_like添加到Fb pgae中的应用
现在我收到了这个错误:
{Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 2000, errorType: OAuthException, errorMessage: (#2000) The publish_likes feature is disabled for this application.}, isFromCache:false}
答案 0 :(得分:-1)
在Facebook Developers上的应用下,转到应用详情,然后点击配置应用中心权限。然后确保您在应用中心权限下拥有相应的权限。
已更新:我认为您还需要添加 publish_likes 标记