我正在使用社交框架和帐户框架从我的应用程序访问 facebook。我用一行代码:
NSURL *meInfo = [NSURL URLWithString:@"https://graph.facebook.com/me"];
这是成功的。我得到一个 json 对象和我的数据,然后我可以在我的应用程序中使用它。令人困惑的是,在接下来的代码块中,我这样做了:
NSURL *meInfoPic = [NSURL URLWithString:@"https://graph.facebook.com/me/picture"];
它失败了:
error = {
code = 2500;
message = "An active access token must be used to query information about the current user.";
type = OAuthException;
};
我的访问 token 显然是有效的,所以我不确定发生了什么。我对两者使用的权限都是“publish_stream”。有什么建议吗?
最佳答案
我的错误是在图片请求 URL 中使用了/me/。一旦我用登录用户的用户 ID 替换它,我就得到了进一步的信息。明确地说,我需要这样做:
NSURL *meInfoPic = [NSURL URLWithString:@"https://graph.facebook.com/123456789/picture"];
关于ios - 请求facebook图片时错误码2500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16051114/