必须为对此端点

时间:2015-12-04 12:52:51

标签: ios facebook lua corona

我尝试使用FacebookCorona 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必须是##

1 个答案:

答案 0 :(得分:0)

最好将它们作为?地图传递,而不是连接params和您的参数:

local params = {access_token = tostring(token)}
facebook.request("me/invitable_friend","GET", params)