我试过从我的Android应用程序中做一个FB
用户必须使用FB登录。
但是我在FB响应中遇到了这个错误:
{Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 283, errorType: OAuthException, errorMessage: (#283) Require extended permission: manage_pages}, isFromCache:false}
为什么" manage_pages"是否还需要许可? 我是该帖子存在的页面管理员。
然后我尝试向用户提出额外的许可" manage_pages"
但我仍然得到同样的错误。
private void onSessionStateChange(Session session, SessionState state,
Exception exception) {
List<String> permissions = session.getPermissions();
if (permissions.size() > 0 && !permissions.contains("publish_actions")) {
requestPublishPermissions(this, session,
Arrays.asList("publish_actions", "manage_pages"),
PublicMacros.REQUEST_CODE_PUBLISH_PERMISSIONS);
}
public static void requestPublishPermissions(Activity activity,
Session session, List<String> permissions, int requestCode) {
if (session != null) {
Session.NewPermissionsRequest reauthRequest = new Session.NewPermissionsRequest(
activity, permissions).setRequestCode(requestCode);
session.requestNewPublishPermissions(reauthRequest);
}
}
这是FB的代码:
Request request = new Request(
session,
takeFromPublicMacrosOrServer(currentOffer.fbPostId)
+ "/likes", null, HttpMethod.POST,
new Request.Callback() {
@Override
public void onCompleted(Response response) {
// Request complete
if (response.getError() == null) {
UnlockRequestToServer unlockRequestToServer = new UnlockRequestToServer(
mOffersListActivity,
PublicMacros.TYPE_UNLOCK_FB_LIKE,
currentOffer.fbPostId);
// (4) unlock 4 - skip
sendUnlockRequestToServer(
unlockRequestToServer,
currentLockView);
} else {
final String errorMsg = "error: "
+ response.getError()
.toString();
Log.e(MyLogger.TAG, errorMsg);
if (BaseApplication
.getCurrentActivity() != null) {
BaseApplication
.getCurrentActivity()
.runOnUiThread(
new Runnable() {
public void run() {
if (PublicMacros.DEBUG) {
Toast.makeText(
BaseApplication
.getCurrentActivity(),
errorMsg,
Toast.LENGTH_LONG)
.show();
}
}
});
}
}
String re = response.toString();
}
});
request.executeAsync();
}
答案 0 :(得分:0)
如果您使用的是Graph API v2.0或更高版本,则在使用manage_pages
等扩展权限时,您的应用需要进行审核才能与应用管理员或开发者之外的其他用户一起使用。
我怀疑这是你的问题。
在这里查看我的答案:Facebook me/feed can only post on developers account only