「applicationStart」は機能していますが、「applicationResume」は機能しません。すでに「UIApplicationExitsOnSuspend = false」を設定しています。また、実際にコロナ シミュレーターでは動作するのに、実際のデバイス (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