Skip to content

Instantly share code, notes, and snippets.

@rbreve
Created July 17, 2013 00:53
Show Gist options
  • Save rbreve/6016712 to your computer and use it in GitHub Desktop.
Save rbreve/6016712 to your computer and use it in GitHub Desktop.
--local storyboard = require "storyboard"
--storyboard.gotoScene( "chooseLevel" )
local facebook = require("facebook")
local json = require("json")
-- listener for "fbconnect" events
local function listener( event )
if ( "session" == event.type ) then
-- upon successful login, request list of friends
if ( "login" == event.phase ) then
facebook.request( "me/friends" )
end
elseif ( "request" == event.type ) then
-- event.response is a JSON object from the FB server
local response = event.response
print( response )
facebook.request( "me/feed", "POST", {message = "Probando Algo"} )
end
end
-- first argument is the app id that you get from Facebook
facebook.login( "99999999999999", listener, {"publish_stream"} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment