I can get scores from facebook but cannot submit scores?
Why wont this work?
local FBlistener
local FBappId = “myActualAppID”
local function FBonClick( event )
if(event.phase == “release”) then
facebook.login( FBappId, FBlistener, {“publish_actions”} )
end
end
function FBlistener( event )
if ( “session” == event.type ) then
if ( “login” == event.phase ) then
facebook.request( “me/scores”, “POST”, {score = 1} ) --score set to 1 just to test
end
elseif ( “request” == event.type ) then
if ( event.isError ) then
local response = event.response
local errorText = display.newText(response, 0, 0, font1, 20 )
errorText:setTextColor(7, 52, 63)
errorText.x = display.contentWidth / 2
errorText.y = 25
GUI:insert(errorText)
print(response)
end
end
end
local FBbutton = ui.newButton {
defaultSrc = “fb.png” , defaultX = “300” , defaultY = “50”,
onEvent = FBonClick,
id = “FBbutton”
}
FBbutton.x = display.contentWidth / 2
FBbutton.y = display.screenOriginY + buttonsYmove + buttonsYdif*3 -10
GUI:insert(FBbutton) [import]uid: 20289 topic_id: 30164 reply_id: 330164[/import]