我尝试使用Facebook
在Corona SDK
中使用以下代码发出请求:
local function facebookListener(event)
if (event.type == "session") then
if (event.phase == "login") then
token = event.token
print("token "..token)
facebook.request( "me/invitable_friend?access_token="..token)
elseif (event.type == "request") then
native.showAlert("Facebook listener", "request")
if ( not event.isError ) then
native.showAlert("req", event.type)
-- -- local response = event.response
print("response "..event.response )
else
native.showAlert("erro", "erro")
end
end
end
end
登录结果返回令牌并发出请求....但请求在控制台日志中返回以下错误:
FBSDKLog:对端点请求的错误' me / invitable_friend?access_token = ACCESS_TOKEN_REMOVED':开放的FBSession必须是##
答案 0 :(得分:0)
最好将它们作为?
地图传递,而不是连接params
和您的参数:
local params = {access_token = tostring(token)}
facebook.request("me/invitable_friend","GET", params)