有没有人知道如何使用fb_graph拉取facebook朋友的列表?我目前的代码如下,但它不起作用。我正在使用设计和omniauth。
在我的用户控制器中
def profile
profile ||= FbGraph::User.me(self.authentications.find_by_provider('facebook').token).fetch
end
在我看来
<% current_user.profile.friends.each do |friend| %>
<%= friend.uid %>
<% end %>
我一直在寻找解决方案,但仍然徒劳无功,如果有人能告诉我线索,我会很感激。
答案 0 :(得分:0)
使用friend.identifier
代替friend.uid
。