[英]Pulling data from Facebook Graph API 2.0 Object
我在Koala中使用Facebook的Graph API 2.0。 現在,當您使用以下方式致電user_friends時
<% @friends = @graph.get_connections("me", "friends") %>
您應該得到一個包含如下內容的對象:
{
"data": [
{
"name": "Friend 1",
"id": "xxxxx"
},
{
"name": "Friend 2",
"id": "xxxx"
},
],
"paging": {
"next": "https://graph.facebook.com/v2.1/...."
},
"summary": {
"total_count": number of friends
}
}
我的問題是如何從摘要中提取信息。 我嘗試在我的ruby應用程序中打印此文件,但僅看到以下內容:
[]
這是否意味着回報為零? 我試圖打電話給@ friends.summary,但這沒用
思考?
https://developers.facebook.com/docs/apps/changelog
現在,通過/ me / friends端點返回的朋友列表僅限於已授權您的應用的朋友列表。
當然,還請確保您已獲得user_friends權限授權。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.