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
.
精彩评论