このメッセージを Facebook に投稿しようとしています:I have achieved (".. scorepost,") points, playing... download for FREE iPhone & Android at www.site
しかし、それは投稿だけです:私は1000を達成しました) 1000はmath.random(100、1000)の結果です; そのビットは機能しており、毎回正しい数を投稿していますが、残りのポイント、再生中は投稿していません... www.siteで無料のiPhoneとAndroidをダウンロードしてください
local facebook = require "facebook"
local fbAppID = "appID"
scorepost = math.random(100, 1000);
keeping_score = true
scoreText = display.newTmessageext( "Score: " .. scorepost, 20, 20,nil, 40)
scoreText:setTextColor(255,255,255)
local faceFunc = function ()
function onLoginSuccess()
facebook.request( "me/feed", "POST", {message = "I have achieved (".. scorepost,") points, playing... download for FREE iPhone & Android at www.site"} )
end
-- facebook listener
function fbListener( event )
if event.isError then
native.showAlert( "ERROR", event.response, { "OK" } )
else
if event.type == "session" and event.phase == "login" then
-- login was a success; call function
onLoginSuccess()
elseif event.type == "request" then
-- this block is executed upon successful facebook.request() call
native.showAlert( "Success", "The post has been uploaded.", { "OK" } )
end
end
end
-- photo uploading requires the "publish_stream" permission
facebook.login( fbAppID, fbListener, { "publish_stream" } )
end
--Button to activate the post to facebook
local facebutton = display.newRect (0, 0, 50, 50)
facebutton.x = display.contentWidth/2; facebutton.y = display.contentHeight/2
facebutton:addEventListener("tap", faceFunc)