facebook SSO post message to feed
guide to setup facebook app: http://blog.anscamobile.com/2011/12/uploading-photos-to-facebook-in-corona/
facebook = require "facebook"
function onLoginSuccess()
facebook.request( "me/feed", "POST", {
message="Test message",
name="The Name",
caption="Caption",
link="http://itunes.apple.com/us/app/your-app-name/id1234567890?mt=8",
picture="http://www.yoursite.com/pic.png" } )
end
-- facebook listener
function fbListener( event )
if event.isError then
native.showAlert( "ERROR", event.response, { "OK" } )
else
if event.type == "session" and event.phase == "login" then
-- login was a success; call function
onLoginSuccess()
elseif event.type == "request" then
-- this block is executed upon successful facebook.request() call
native.showAlert( "Success", "The msg has been posted.", { "OK" } )
end
end
end
-- You must use your own app id for this sample to work
local fbAppID = "1234567890" --fake
-- photo uploading requires the "publish\_stream" permission
facebook.login( fbAppID, fbListener, { "publish\_stream" } )
build.settings
[code]
CFBundleIdentifier = “com.site.AppName”,
CFBundleDisplayName = “App Name”,
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“fb1234567890”,
}
}
},
[/code] [import]uid: 96683 topic_id: 19207 reply_id: 74669[/import]