I’ve just finished to test this on the latest public release, try this code
build.settings
settings = { orientation = { default = "portrait", content = "portrait", supported = { "portrait" } }, iphone = { plist = { UIApplicationExitsOnSuspend = false, FacebookAppID = "XXXXXXXXXX", -- replace XXXXXXXXXX with your facebook appId CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXX", -- replace XXXXXXXXXX with your facebook appId } } } } } }
main.lua
-- Classes local facebook = require("facebook"); -- Constants and variables local \_W = display.contentWidth; local \_H = display.contentHeight; local \_CX = \_W\*0.5; local \_CY = \_H\*0.5; -- Configuration io.output():setvbuf('no'); display.setStatusBar( display.HiddenStatusBar ); local background = display.newRect(0,0,\_W,\_H); background:setFillColor(10,70,200); background:setReferencePoint(display.CenterReferencePoint); background.x = \_CX; background.y = \_CY; local description = display.newText("touch to open fb dialog", 0,0,native.systemfont,\_W\*0.075); description:setReferencePoint(display.CenterReferencePoint); description.x = \_CX; description.y = \_CY; local function touchHandler(event) if event and event.phase == "ended" then -- listener for "fbconnect" events local function listener( event ) if ( "session" == event.type ) then -- upon successful login, request list of friends if ( "login" == event.phase ) then local function onComplete(event) print("calling on complete with event = "..tostring(event)); for k,v in pairs(event) do print("event k="..tostring(k).." v="..tostring(v)); end end facebook.showDialog( "apprequests", { message="You should download this game!" }, onComplete ); end elseif ( "dialog" == event.type ) then print( event.response ) end end -- first argument is the app id that you get from Facebook facebook.login( "XXXXXXXXXX", listener ) --replace XXXXXXXXXX with your Facebook App ID end end background:addEventListener("touch", touchHandler);
As you can see your friends will receive the request but nothing returns to the showDialog callback.
In my case I need how many friends are selected and if possible the request id, maybe also friends ids to track request and give something to the player like an extra life in Candy Crush