On the Facebook API page, it says we can post messages and photos to friends accounts, but I have not been able to do it.
All I want is to invite my FB friends to try my Corona-made-app by posting on my FB friends’ wall – preferably by selecting specific friends from a list of FB friends that Corona app may return using Facebook API. (If posting on selected friends’ wall isn’t possible, I’d be happy with posting the invite message to all my FB friends.)
When I do the following, I can post a message on my own FB wall.
-- inside the FB listener
if event.phase == "login" then
local attachment = {
name = "MyGameTitle",
link = "http://www.mygamesite.com",
message = "My message string here",
picture = "http://www.mygamesite.com/myimage.png",
actions = json.encode( { name="Learn More", link="http://www.mygamesite.com"} )
}
facebook.request( "me/feed", "POST", attachment )
end
But how do I post the attachment on my FB friends’ wall? The following doesn’t seem to do anything:
-- inside the FB listener
if event.phase == "login" then
local attachment = {
name = "MyGameTitle",
link = "http://www.mygamesite.com",
message = "My message string here",
picture = "http://www.mygamesite.com/myimage.png",
actions = json.encode( { name="Learn More", link="http://www.mygamesite.com"} )
}
facebook.request( "me/friends" )
facebook.request( "friends/feed", "POST", attachment )
end
Even though it says on Facebook API page that we should be able to post on friends account, can we really do it right now? If so, is there a code snippet that I can refer to? Facebook sample code that comes with SDK does not include how it may be achieved.
I imagine I need to do something after facebook.request( “me/friends” ), but I don’t know what that might be.
I would so appreciate any help/pointer. (I’m using Daily Build 825 on Mac.)
Naomi [import]uid: 67217 topic_id: 26848 reply_id: 326848[/import]
