无法发表完整的消息到Facebook。
2013-2-26 17:36:55
收藏:0
阅读:143
评论:2
我试图向 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)
点赞
用户1130744
您在scorepost后使用了“,”而不是“..”,因此假设scorepost为100,您发送了类似于:
{
"message":"我已经获得(1oo",
") points, playing... download for FREE iPhone & Android at www.site"
}
2013-02-27 12:01:32
评论区的留言会收到邮件通知哦~
推荐文章
- 如何将两个不同的lua文件合成一个 东西有点长 大佬请耐心看完 我是小白研究几天了都没搞定
- 如何在roblox studio中1:1导入真实世界的地形?
- 求解,lua_resume的第二次调用继续执行协程问题。
- 【上海普陀区】内向猫网络招募【Skynet游戏框架Lua后端程序员】
- SF爱好求教:如何用lua实现游戏内调用数据库函数实现账号密码注册?
- Lua实现网站后台开发
- LUA错误显式返回,社区常见的规约是怎么样的
- lua5.3下载库失败
- 请问如何实现文本框内容和某个网页搜索框内容连接,并把网页输出来的结果反馈到另外一个文本框上
- lua lanes多线程使用
- 一个kv数据库
- openresty 有没有比较轻量的 docker 镜像
- 想问一下,有大佬用过luacurl吗
- 在Lua执行过程中使用Load函数出现问题
- 为什么 neovim 里没有显示一些特殊字符?
- Lua比较两个表的值(不考虑键的顺序)
- 有个lua简单的项目,外包,有意者加微信 liuheng600456详谈,最好在成都
- 如何在 Visual Studio 2022 中运行 Lua 代码?
- addEventListener 返回 nil Lua
- Lua中获取用户配置主目录的跨平台方法
你不应该通过连接字符串的方式,像这样:
facebook.request( "me/feed", "POST", {message = "我已经获得了 ("..scorepost..") 分, 玩游戏... 在 www.site 免费下载 iPhone 和 Android 版本"} )