Corona SDK network.request未触发

我在使用Corona SDK中的qrscanner插件扫描QR码并执行仅两个函数。首先,它会检查DB中的布尔值,如果该值为0,则应显示一条消息并将其更改为1。

第一个网络调用可正常工作并在应用程序中更新测试,但第二个网络调用没有返回任何内容。代码非常基础,因为这是我的第一个lua/corona脚本。

local json = require( "json" )
local function handleResponse( event )
    if not event.isError then

        local data,pos,msg= json.decode(event.response)
        print( event.response )

        if not data then
            native.showAlert('error, no response', 'no response from the server', {'OK'})
        else
            if data.checked_in == "0" then
                myText.text = "尚未签入。\n车辆详细信息:\n登记编号:\n"..data.registration.."\n制造商:\n"..data.make.."\n型号:\n"..data.model.."\n"
                urx2 = "http://mydomain/index.php/checkin/"..message
                network.request( urx2, "GET", handleResponse2 )
                print('扫描的消息:', message)
            else
                myText.text = "警告:车辆已经签入。\n车辆详细信息:\n登记编号:\n"..data.registration.."\n制造商:\n"..data.make.."\n型号:\n"..data.model.."\n"
            end
        end
    else
        native.showAlert('该URL已损坏:'..urx, message, {'OK'})
    end
    return true
end

local function handleResponse2( event )
    if not event.isError then

        local data,pos,msg= json.decode(event.response)
        print( event.response )

        if not data then
            native.showAlert('错误,没有响应', {'OK'})
        else
            if data.checked_in == "0" then
                myText.text = "仍未签入,请重试。"
            else
                myText.text = "成功签入。"
            end
            sceneGroup:insert( summary )
            print(data.checked_in)
        end
    end
    return true
end

local function status_listener(message)
    urx = "http://mydomainindex.php/checkedin/"..message
    network.request( urx, "GET", handleResponse )
end

local function checkin_listener(message)
    urx = "http://mydomain/index.php/checkin/"..message
    network.request( urx, "GET", handleResponse2 )
    print('扫描的消息:', message)
end

所以到目前为止,一切都正常:

                if data.checked_in == "0" then
                myText.text = "尚未签入。\n车辆详细信息:\n登记编号:\n"..data.registration.."\n制造商:\n"..data.make.."\n型号:\n"..data.model.."\n"
                urx2 = "http://mydomain/index.php/checkin/"..message
                network.request( urx2, "GET", handleResponse2 )
                print('扫描的消息:', message)

我错过了什么吗?

点赞