Corona'ApplicationResume'事件在iOS上不起作用

时间:2013-03-27 16:17:35

标签: ios xcode cocoa-touch corona

'applicationStart'正在运行,但是'applicationResume'不起作用,我已经设置了“UIApplicationExitsOnSuspend = false”。 另外奇怪的是它实际上适用于Corona Simulator,但不能在真实设备(iPhone5 / iOS6)上运行。

以下是代码:

local onSystem = function( event )
if event.type == "applicationStart" then
    system.cancelNotification()
     native.setProperty( "applicationIconBadgeNumber",0)
elseif event.type == "applicationExit" then
    print("exit")
elseif event.type == "applicationSuspend" then
    print("suspend")
elseif event.type == "applicationResume" then
    native.showAlert( "Hihi", "", { "OK" } )
end
end

-- setup a system event listener
Runtime:addEventListener( "system", onSystem )

任何想法?

我找到了另一个事件处理程序代码:

local function onSystemEvent( event ) 
if event.type == "applicationStart" then
    --fb.logout();        
     return true
end
if event.type == "applicationExit" then
    --fb.logout();
    return true
end
end

0 个答案:

没有答案