Hi everyone !
I’m having a problem with getting a friends list from Facebook. Right now, I’m using the Facebook V4 api. I’d like to allow the user to connect to Facebook, retrieve his friends list, select one of them and get their user ID (or “app scoped user ID”).
So far, everythink seems to work : I’m able to log in to Facebook, to retrieve the friends list, show the dialog popup, select a friend who has installed the app. The problem is that the returned data is totally empty.
I do have some event.data, I’m also able to print #event.data, but when I try to print the firstName, the lastName, the firstName, or the id, there’s nothing.
-- Asking for permissions facebook.login(fbAppID, facebookListener, {"publish\_actions, user\_friends"}) -- Facebook Friends List Listener local function onCompleteFB(event) if event.data ~= nil then print("Number of selected friends : " .. #event.data) print("#event.data[1] : " .. #event.data[1]) end end -- Showing the friends list facebook.showDialog("friends", onCompleteFB)
print(#event.data) returns a table but #event.data[1] returns 0 (instead of 2 in my case, since I’ve got 2 other friends using the app and who showed up in the dialog popup).
How can I retrieve the friends user ID ?