无法发表完整的消息到Facebook。

我试图向 Facebook 发布此消息:“我已经获得( .. scorepost,)分,玩...... iPhone&Android 免费下载在www.site”,

但是它只发布了:“我已经获得1000分)1000是math.random(100,1000);的结果那部分正在工作并且每次都发布了正确的数字,但它没有发布其他内容:分,玩......iPhone&Android 免费下载在www.site

local facebook = require "facebook"
local fbAppID = "appID"

scorepost = math.random(100, 1000);
keeping_score = true
scoreText = display.newText("Score: "..scorepost, 20, 20,nil, 40)
scoreText:setTextColor(255,255,255)

local faceFunc = function ()

    function onLoginSuccess()
        facebook.request( "me/feed", "POST", {message = "我已经获得(" .. scorepost .. ")分,玩...... iPhone&Android 免费下载在www.site"} )
    end

    -- facebook listener
    function fbListener( event )
        if event.isError then
            native.showAlert( "错误", event.response, { "好" } )
        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( "成功", "已上传该文章。", { "好" } )
            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)
点赞
用户1190388
用户1190388

你不应该通过连接字符串的方式,像这样:

facebook.request( "me/feed", "POST", {message = "我已经获得了 ("..scorepost..") 分, 玩游戏... 在 www.site 免费下载 iPhone 和 Android 版本"} )
2013-02-26 18:15:54
用户1130744
用户1130744

您在scorepost后使用了“,”而不是“..”,因此假设scorepost为100,您发送了类似于:

{
  "message":"我已经获得(1oo",
  ") points, playing... download for FREE iPhone & Android at www.site"
}
2013-02-27 12:01:32