I’m attempting to build in Facebook sharing in to my app and it is going well with one little exception.
I click on my share button and Facebook opens as expected but then shows a screen that says “You have already authorized My App Name]].” At the top of the screen are a cancel button and an ok button. Below that text are two more buttons, skip and ok.
Now, the behavior that I imagined was that it would show the message and whatnot that I included in my app (I’ll post the code that I am using below). There was no indication from this (in my mind) that any posting was actually going to happen. I closed the button dialog, went back to my app, and tried the “Share button” again and got the same screen. So I tried again. And again. Well, when I went to my Facebook page, I had a post (as I laid it out) for each time that I hit the button. Which was a LOT.
Perhaps I don’t understand the flow, but is this the expected behavior? I would imagine that a user would see what was being posted before it actually got posted. Is this not the way that this works? Is there a better way to implement this?
The code I am using is below.
Thanks for any help or advice.
All the best,
Alan
local onShareTouch = function(event)
if event.phase == “release” then
local fbAppId = “I do actually have my Facebook app id here”
local appleId = “xxxxxx”
local facebookListener = function(event)
if (“session” == event.type) then
if (“login” == event.phase) then
facebook.request(“me/feed”, “POST”, {
message = shareMessage,
name = “game name”,
caption = “message caption”,
link = “appstorelink”,
picture=“http://www.alanmthomas.com/facebookShare100.png”})
end
end
end
facebook.login(fbAppId, facebookListener, {“publish_stream”})
end
end