Hello, I’ve noticed that my “post score to Facebook” is not working on my Android device anymore. Any ideas of why this has stopped working?
this code was valid, has something changed?
here’s the code:
-- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* --
-- connectHandler (for facebook posting)
-- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* --
local function connectHandler( event )
local post = "Playing App!"
local gameScore = getScore()
gameScore = comma\_value(gameScore)
local session = event.sender
if ( session:isLoggedIn() ) then
print( "fbStatus " .. session.sessionKey )
local scoreStatusMessage = "just scored a " .. tostring(gameScore) .. " on App."
local attachment = {
name="Download App To Compete With Me",
caption="Think you can beat my score of " .. tostring(gameScore) .. "? I dare you to try!",
href="https://market.android.com/details?id=",
media= { { type="image", src="http://www.server.com/Icon\_90.png", href="https://market.android.com/details?id=" } }
}
local action\_links = {
{ text="Download App", href="https://market.android.com/details?id=" }
}
local response = session:call{
message = scoreStatusMessage,
method ="stream.publish",
attachment = json.encode(attachment),
action\_links = json.encode(action\_links),
}
if "table" == type(response ) then
-- print contents of response upon failure
printTable( response, "fbStatus response:", 5 )
end
local onComplete = function ( event )
if "clicked" == event.action then
local i = event.index
if 1 == i then
-- Player click 'Ok'; do nothing, just exit the dialog
end
end
end
-- Show alert with two buttons
local alert = native.showAlert( "App", "Your score has been posted to Facebook.",
{ "Ok" }, onComplete )
end
end
Thanks,
Dylan [import]uid: 98618 topic_id: 23474 reply_id: 323474[/import]
[import]uid: 52491 topic_id: 23474 reply_id: 94402[/import]