UPDATE
Well, now I’m thoroughly confused. I guess it’s NOT a daily build issue, because I tried the last stable build as well and I’m *still* getting this weirdness with FB opening in Safari and *not* in a popup like it used to.
I even tested this super-simple version below and THAT doesn’t work for me either! This is essentially the code from the tutorial and it USED TO work for me, but suddenly it doesn’t.
Here’s the code, but it’s really no different than the simple FB tutorial. Any thoughts?
[blockcode]
local ui = require(“ui”)
local facebook = require(“facebook”)
local json = require(“json”)
local tableView = require(“tableView”)
local localGroup = display.newGroup()
local fbButton = display.newImage (“fbButton184.png”)
fbButton.x = 160
fbButton.y = 200
localGroup:insert(fbButton)
local fbButton_logout = display.newImage (“fbButton184.png”)
fbButton_logout.x = 160
fbButton_logout.y = 400
localGroup:insert(fbButton_logout)
– The above are login and logout buttons.
– FACEBOOK –
local function printTable( t, label, level )
if label then print( label ) end
level = level or 1
if t then
for k,v in pairs( t ) do
local prefix = “”
for i=1,level do
prefix = prefix … “\t”
end
print( prefix … “[” … tostring(k) … "] = " … tostring(v) )
if type( v ) == “table” then
print( prefix … “{” )
printTable( v, nil, level + 1 )
print( prefix … “}” )
end
end
end
end
local callFacebook = function()
local facebookListener = function( event )
if ( “session” == event.type ) then
if ( “login” == event.phase ) then
local theMessage = “Check it out! I’m playing Word Traveller and just scored 123,000 points on 4-LETTER WORDS!”
facebook.request( “me/feed”, “POST”, {
message=theMessage,
name=“Try WORD TRAVELLER now, for FREE!”,
caption=“If you love word games like Scrabble, crosswords, anagrams or the game show Lingo, you’ll love Word Traveller. Figure out the secret words to complete each round and play for trophies and high scores.”,
link=“http://www.slice.net/”,
picture=“http://slice.kodingen.com/WT_Logo_FB_wall.png”,
actions = json.encode( { { name = “Word Traveller”, link = “http://www.slice.net” } } )
} )
end
end
end
– Naturally you will want to put your own info above
facebook.login( “123456789”, facebookListener, { “publish_stream” } )
end
– the above should be your Facebook app ID
local function callFB (event)
if event.phase == “ended” then
callFacebook()
end
end
local function callFBlogout (event)
if event.phase == “ended” then
facebook.logout()
end
end
fbButton:addEventListener(“touch”, callFB)
fbButton_logout:addEventListener(“touch”, callFBlogout)
[/blockcode] [import]uid: 49670 topic_id: 21550 reply_id: 85925[/import]