开发者

Pull friends uid using fb_graph

does anyone know how to pull a list of facebook friends开发者_如何转开发 uid using fb_graph? My current code is below but it does not work. I'm using devise and omniauth.

In my user controller

def profile
  profile ||= FbGraph::User.me(self.authentications.find_by_provider('facebook').token).fetch
end

In my view

<% current_user.profile.friends.each do |friend| %>
<%= friend.uid %>
<% end %>

I've been looking for solution for days but still in vain and will appreciate if anyone could tell me the clue.


Use friend.identifier instead of friend.uid.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜