Well I restored my code back to the Sample Code from the SDK for Facebook; changed the appId to my string and then the code worked fine… so from within my game I was posting to facebook with only one strange behavior, it was posting twice instead of once. And now the app won’t post anymore - so again I don’t know if FB is suspending me for some reason or not.
Facebook code has been troublesome from the word go - but probably API user error on my part. I guess. Back to the debugging board.
SOLUTION: What I have deduced is that the sample code in main.lua does not clear out fbCommand state flag with nil once you’re in the event.type “session”. The problem here is that you can repeatedly attempt to facebook.request() due to the listener triggering periodically. I recommend people try this if they start having mirror posts:
if ( "session" == event.type ) then
-- event.phase is one of: "login", "loginFailed", "loginCancelled", "logout"
statusMessage.textObject.text = event.phase -- tjn Added
-- This code posts a photo image to your Facebook Wall
--
if fbCommand == POST\_PHOTO then
fbCommand = nil
fbCommandResponse = POST\_PHOTO
local attachment = {
name = "Developing a Facebook Connect app using the Corona SDK!",
link = "http://www.acme.com",
caption = "Link caption",
description = "This is a gorilla.",
picture = "http://www.acme.com/gorilla.jpg",
actions = json.encode( { { name = "Learn More", link = "http://www.acme.com" } } )
}
facebook.request( "me/feed", "POST", attachment ) -- posting the photo
end
You will note the fbCommandResponse I added after setting fbCommand to nil, fbCommandResponse is then used in the event.type “request” portion of the following code instead. This technique of clearing the state flag ENSURES that you only execute your code one time only, avoiding the potential flooding of Facebook and having your Facebook page ban your App for a period of time. (that duration still unknown at this time) [import]uid: 74844 topic_id: 13980 reply_id: 54278[/import]