我建立一個Rails後端爲iOS應用。後端需要與Facebook接口來抓取和使用每個用戶的Facebook好友。Facebook好友請求返回空 - 儘管權限
但Facebook的「朋友」的請求返回空。
我從根本上讓下列要求:
curl https://graph.facebook.com/[FILTERED_USER_ID_FOR_APP]?fields=friends&access_token=[FILTERED]&debug=all
我已經看了關於這個StackOverflow的每噸職位(this one和this one,和this one,更多),但還沒有找到一個相同的問題或適合的解決方案。
我似乎有正確設置權限。無論是在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"
}
]
}
}
什麼是令人費解的我是一)應用程序ID /用戶ID /訪問令牌似乎是正確的,因爲我可以得到基本的個人資料信息,並B)我做不得到一個錯誤告訴我該請求沒有適當的權限。如果我做了類似的請求沒有權限上the explorer,它返回一個相關的調試注:
{
"message": "The field 'friends' is only accessible on the User object after the user grants the 'user_friends' permission.",
"type": "warning"
}
如果我讓與在資源管理器中正確的權限,它返回的朋友列表(data
陣列)。
所以它不似乎是一個權限問題,但請求返回一個空的朋友列表。有任何想法嗎?
你確定你已經解釋了這個? http://stackoverflow.com/questions/23417356/facebook-graph-api-v2-0-me-friends-returns-empty-or-only-friends-who-also-u – Igy