android - 为什么使用 Graph API 获取 FB 头像需要访问 token ?

标签 android facebook-graph-api android-facebook

我想使用以下链接 fpor 示例使用 graph api 显示个人资料图片:

https://graph.facebook.com/me/picture?redirect=0&height=200&type=normal&width=200

我收到回复:

{
   "error": {
      "message": "An active access token must be used to query information about the current user.",
      "type": "OAuthException",
      "code": 2500
   }
}

在哪里 link他们说

Because profile pictures are always public on Facebook, this call does not require any access token.

最佳答案

URI 中的 me 只是一个占位符,您需要将实际的 Facebook user-id 放入,例如标题 (/{user- id}/picture) 链接页面的建议。

例如:

https://graph.facebook.com/snoopdogg/picture?redirect=0&height=200&type=normal&width=200

...返回以下内容:

{
   "data": {
      "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash3/c11.0.433.433/s200x200/598452_10151897536239807_882122819_n.jpg",
      "width": 200,
      "height": 200,
      "is_silhouette": false
   }
}

关于android - 为什么使用 Graph API 获取 FB 头像需要访问 token ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21318607/

相关文章:

android - 如果 LazyGridView 在撰写中没有子项,则滑动刷新不起作用

android - 在 Android 中实现 switch case 语句的正确方法是什么?

javascript - facebook 连接 javascript sdk 在 IE 中不起作用?

android - 首次登录后,Facebook Profile.getCurrentProfile() 始终返回 null

android - MediaRecorder 输出 0 字节文件

Android 应用程序显示来自 URL 的图像

Facebook API 错误代码 : 100 Error Message: Viewer cannot message specified recipients

objective-c - 社交框架在尝试获取用户提要时返回 "(#803) Cannot query users by their username (username)"

android - 使用 Parse 运行简单的 android facebook 集成程序时出现异常

android - 自定义 Facebook OAuth 对话框中的文本