Facebook showDialog within showAlert

Hey,

I’m currently using the following:

local alert = native.showAlert( "A Star for a Star", "Send an in-game star to a friend and receive one yourself as well", { "Yes Please", "No Thanks" }, onComplete )

And then in the onComplete function, I call the following:

local facebook = require "facebook" local function fbListener( event ) if event.isError then native.showAlert( "ERROR", event.response, { "OK" } ) else if event.type == "session" then if event.phase == "login" then facebook.showDialog( "apprequests", { message = "Here is a star, just for you :)" } ) end elseif ( "dialog" == event.type ) then print("Received dialog information: ") print( event.response ) end end end -- Call facebook facebook.login( \_G["gFBappID"], fbListener, {"read\_insights","publish\_stream"} )

This works perfectly fine on Android, but on iOS the dialog is closed immidiately. Trying to call showDialog without the native.ShowAlert works fine. Suggestions?

I encountered the same issue.  If you put your call to facebook.showDialog within a timer.performWithDelay (about 500ms is sufficient), then it should work.

  • Andrew

I encountered the same issue.  If you put your call to facebook.showDialog within a timer.performWithDelay (about 500ms is sufficient), then it should work.

  • Andrew