Sas*_*sha 2 facebook facebook-graph-api facebook-graph-api-v2.7
我正在为iOS应用程序构建Rails后端.后端需要与Facebook连接以获取和使用每个用户的Facebook好友.
但Facebook'朋友'的要求是空的.
我基本上提出以下要求:
curl https://graph.facebook.com/[FILTERED_USER_ID_FOR_APP]?fields=friends&access_token=[FILTERED]&debug=all
Run Code Online (Sandbox Code Playgroud)
我已经看了很多关于这个的StackOverflow帖子(这个,这个,这个,还有更多),但没有找到相同的问题或适合的解决方案.
我似乎已正确设置权限.在Rails应用程序和用户通过iPhone应用程序进行身份验证时,我都设置user_friends
为权限之一,事实上,当有人注册时,它会要求他们确定用户朋友的权限.
但是,当我居然要求他们的朋友,我得到回应,告诉我,有有很多朋友,但没有返回任何人.以下响应适用于在应用上肯定有朋友的用户.
{
"data":[],
"summary": {
"total_count": 419
},
"__debug__": {
"messages": [
{
"link": "https:\/\/developers.facebook.com\/docs\/apps\/versions\/",
"message": "No API version was specified. This request defaulted to version v2.7.","type":"warning"
},
{
"link": "https:\/\/developers.facebook.com\/docs\/apps\/changelog#v2_0",
"message": "Only friends who installed this app are returned in API v2.0 and higher. total_count in summary represents the total number of friends, including those who haven't installed the app.",
"type": "info"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
令我困惑的是a)应用程序ID /用户ID /访问令牌似乎是正确的,因为我可以获得基本的配置文件信息,以及b)我没有收到错误,告诉我该请求没有适当的权限.如果我在资源管理器上没有权限的情况下发出类似请求,则会返回相关的调试说明:
{
"message": "The field 'friends' is only accessible on the User object after the user grants the 'user_friends' permission.",
"type": "warning"
}
Run Code Online (Sandbox Code Playgroud)
如果我在资源管理器中使用正确的权限进行创建,则会返回一个朋友列表(在data
数组中).
所以它似乎不是权限问题,但请求返回一个空的好友列表.有任何想法吗?
归档时间: |
|
查看次数: |
1113 次 |
最近记录: |