Hi guys, I’ve tried to follow several guides on the Corona website, but none of them worked for me.
I’ve already implemented Facebook in my App, everything seems to be setted in the right way.
Now I just want to retrive the list of all my Facebook’s friend and send them a notification that contains something like “play my brand new game”.
Actually I’m using the following code:
local function onComplete( event ) print( "event.name:", event.name ) print( "event.type:", event.type ) if ( event.data ) then -- event.data is a table of friends returned. -- event.data[1] will be the first friend returned. -- Each friend will have a list of fields returned like: ----- event.data[1].firstName ----- event.data[1].fullName ----- event.data[1].lastName ----- event.data[1].id end end -- Listener for "fbconnect" events local function listener( event ) if ( "session" == event.type ) then if ( "login" == event.phase ) then facebook.showDialog( "friends", onComplete ) end elseif ( "dialog" == event.type ) then print( event.response ) end end local FBAppID = "my app ID" facebook.login( FBAppID, listener, { "publish\_actions", "user\_friends" } ) local function showDialog( event ) if ( event.phase == "ended" ) then facebook.showDialog( "friends", onComplete ) end return true end local button = widget.newButton{ label = "Pick Friends", onEvent = showDialog, } button.x = display.contentCenterX button.y = display.contentCenterY
The friend picker plugin pops up, but the list of friends is empty.
What am I doing wrong? I really cannot understand.
Thanks for anyone that replies.
Best regards.