problem with posting to facebook wall using GGFacebook

I’m trying to post to my wall on pressing the button using GGfacebook lib. Simplepost doesn’t work. 

This code works, so I know that my facebook app preferences are okay.
 

local GGFacebook = require "GGFacebook" local widget = require("widget") local facebook = GGFacebook:new( "582371231835090") facebook:login() buttonRelease = facebook:showDialog( "feed", { message="You should download this game!" } ) print( facebook:isLoggedIn() ) local button = widget.newButton { defaultFile = "button1.png", overFile = "button2.png", onRelease = buttonRelease, } 

It works, but yet there are some issues: 

  1. the dialog shows up when the app starts not when the button is released
  2. the message is not shown. 

Will be glad if you clear it out. thanks!

I would say it is probably this line:

buttonRelease = facebook:showDialog( "feed", { message="You should download this game!" } )

It should be a function like this:

local buttonRelease = function(event) facebook:showDialog( "feed", { message="You should download this game!" } ) end

OMG I must have been working too much lately as I miss such things…
thank you.
I’ve already changed the code and it works when the button is realesed.

Yet my message is not shown in the dialog box.

I’m not sure why you message isn’t shown. I don’t use GGFacebook myself and I don’t open a dialog box for fb posts.

Mine are like this:

 local postMsg = { name = "some stuff", picture = "stuff.jpg", caption = "more stuff", message = "posting stuff to wall" } facebook.request( "me/feed", "POST", postMsg )

Facebook removed the ability to prefill the feed dialog with a message some time ago. See this blog post for more info.

I see… but how can we post highscore, for example? It is not longer possible?

You just need to do what I’ve done above, theres a simplePost funtion in GGFacebook, use that, you don’t need to open a dialog

But simplepost doesn’t work, as I have mentioned. Only dialog works for some reason…

function GGFacebook:post( options )

        facebook.request( “me/feed”, “POST”, options )

end

the above function is also in GGFacebook, so try something like this:

local postMsg = {

                name = “some stuff”,
                picture = “stuff.jpg”,
                caption = “more stuff”,
                message = “posting stuff to wall”
}

GGFacebook:post(postMsg)

I’ve tried it. It doesn’t work. :frowning:

I don’t know so, I only use the facbook.lua lib. Maybe you should do the same, it’s easy to use and corona have good documentation for it.

I would say it is probably this line:

buttonRelease = facebook:showDialog( "feed", { message="You should download this game!" } )

It should be a function like this:

local buttonRelease = function(event) facebook:showDialog( "feed", { message="You should download this game!" } ) end

OMG I must have been working too much lately as I miss such things…
thank you.
I’ve already changed the code and it works when the button is realesed.

Yet my message is not shown in the dialog box.

I’m not sure why you message isn’t shown. I don’t use GGFacebook myself and I don’t open a dialog box for fb posts.

Mine are like this:

 local postMsg = { name = "some stuff", picture = "stuff.jpg", caption = "more stuff", message = "posting stuff to wall" } facebook.request( "me/feed", "POST", postMsg )

Facebook removed the ability to prefill the feed dialog with a message some time ago. See this blog post for more info.

I see… but how can we post highscore, for example? It is not longer possible?

You just need to do what I’ve done above, theres a simplePost funtion in GGFacebook, use that, you don’t need to open a dialog

But simplepost doesn’t work, as I have mentioned. Only dialog works for some reason…

function GGFacebook:post( options )

        facebook.request( “me/feed”, “POST”, options )

end

the above function is also in GGFacebook, so try something like this:

local postMsg = {

                name = “some stuff”,
                picture = “stuff.jpg”,
                caption = “more stuff”,
                message = “posting stuff to wall”
}

GGFacebook:post(postMsg)

I’ve tried it. It doesn’t work. :frowning: