【问题标题】:An open FBSession must be specified for calls to this endpoint必须为此端点的调用指定一个开放的 FBSession
【发布时间】:2016-03-09 10:00:50
【问题描述】:

我正在尝试使用以下代码在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

登录结果返回token,我发出请求....但请求在控制台日志中返回以下错误:

FBSDKLog:对端点“me/invitable_friend?access_token=ACCESS_TOKEN_REMOVED”的请求出错:打开的 FBSession 必须是##

【问题讨论】:

  • 这个很难调试,但我会尝试提供尽可能多的有关您获得的访问令牌的信息,以确定问题所在。请使用developers.facebook.com/tools/debug
  • 我使用这个 url 进行调试 ...输入我的访问令牌,一切正常。但在我的应用程序中,我发现一个开放的 FBSession 必须打开...跨度>

标签: ios facebook lua coronasdk


【解决方案1】:

与其连接? 和您的参数,不如将它们作为params 映射传递:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-01-29
    • 2021-05-01
    • 2022-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多