My app is getting restricted by Facebook because it directly posts to users’ walls without allowing them to edit the posted message. So, I’m switching from facebook.request to facebook.showDialog. It was very straightforward to make this transition. However, while everything seems to work fine the first time you share after the app is first loaded onto the device, during every subsequent share attempt, whether I actually shared or pressed cancel during the first dialog, the dialog will open for a second and then immediately close. No errors are reported in Console and none of the debugging messages I’ve put in have helped me nail this down.
I have used Corona Builds 922 and 942 with the same results.
Below is a sample of the relevant code:
local FB\_App\_ID = "XXXXXXXXXXXXXXX"
local contactFB = function(evt)
local fbLink = "http://appwebsite.com"
local fbText = "App description"
facebook.showDialog("feed", {
name = "App Name",
caption = "app caption",
description = fbText,
link = fbLink
})
return true
end
local fbListener = function(event)
if ( "session" == event.type ) then
-- upon successful login, request list of friends of the signed in user
if ( "login" == event.phase ) then
-- Fetch access token for use in Facebook's API
local access\_token = event.token
contactFB()
elseif event.phase == "logout" then
end
elseif ( "request" == event.type ) then
-- event.response is a JSON object from the FB server
local response = event.response
-- if request succeeds, create a scrolling list of friend names
if ( not event.isError ) then
-
end
elseif ( "dialog" == event.type ) then
print( "dialog", event.response )
end
end
facebook.login( FB\_App\_ID, fbListener, {"publish\_stream"} )
Any feedback would be appreciated! [import]uid: 44153 topic_id: 32609 reply_id: 332609[/import]