Created
July 17, 2013 00:53
-
-
Save rbreve/6016712 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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