An oddity with posting to Facebook

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

This is because you had already authorized your app to post on Facebook, so Facebook is just getting confirmation of that.  I’ve seen that if you remove the app, reinstall the app, then go to login again.  If you click OK, it will log you in.  If you don’t, then you won’t be logged in and you will see the message again when you do something that calls the login.

For getting the screen that shows the user what you are posting and allows them to add a status message, you should use the Facebook showDialog() method.  Note that when using the showDialog() method, you cannot pre-fill the status message part.  It is not an option.

Thanks for the clarification.  That makes sense.  I opted here to go with a web popup that populates the info for sharing.  It seemed a little more user friendly as well as easier for me to implement. 

Thanks so much for the help on this.

This is because you had already authorized your app to post on Facebook, so Facebook is just getting confirmation of that.  I’ve seen that if you remove the app, reinstall the app, then go to login again.  If you click OK, it will log you in.  If you don’t, then you won’t be logged in and you will see the message again when you do something that calls the login.

For getting the screen that shows the user what you are posting and allows them to add a status message, you should use the Facebook showDialog() method.  Note that when using the showDialog() method, you cannot pre-fill the status message part.  It is not an option.

Thanks for the clarification.  That makes sense.  I opted here to go with a web popup that populates the info for sharing.  It seemed a little more user friendly as well as easier for me to implement. 

Thanks so much for the help on this.