LUA朋友邀请facebook

时间:2014-01-16 09:45:55

标签: lua corona

我正在尝试邀请我的脸书朋友加入我的应用程序,但出于某种原因这会让游戏崩溃:

local facebook = require "facebook" 
facebook.showDialog("apprequests", { app_id = ***} ) 

local function facebookListener( event )
    if ( "session" == event.type ) then
        -- upon successful login, request list of friends of the signed in user
        if ( "login" == event.phase ) then
            inviteText.text = "Pulling friend list..."

            local params = {
                    app_id = ***,
                    message = "Try this! Test 123"
                }
            facebook.showDialog("apprequests", params)

            local access_token = event.token
            print( access_token )
        end
    elseif ( "request" == event.type ) then
        -- event.response is a JSON object from the FB server
        local response = event.response

    elseif ( "dialog" == event.type ) then
        print ( "event type:" , event.type)
        print( "event name:" , event.name)
        print ( "event data:", event.data)
        print( "event response: ", event.response)

    end
end 

任何人都知道为什么或有更好的方法做到这一点?

0 个答案:

没有答案