I have encountered what I would qualify as a bug, but I just want to check if it is not a design decision or constraint first.
I try to log an event during the system suspend event.
local function onSystemEvent( event ) if("applicationSuspend" == event.type) then GA.newEvent( "design", { event\_id = "system:suspend"}) suspendApp() elseif("applicationResume" == event.type) then GA.newEvent( "design", { event\_id = "system:resume"}) resumeApp() end end Runtime:addEventListener( "system", onSystemEvent )
Where suspendApp() and resumeApp() are custom functions (calculating the duration of the app suspension, essentially).
When the application suspends, all the code in the custom functions is called, and any print is logged into the console. But not the GA event. In fact, the “system:suspend” event is sent (and logged into the console) only on application resume.
I suspected something like this, but thought the actual suspension took effect after the Corona applicationSuspend (meaning stuff could be done before the app suspends for real).
Anyway, thanks for the answer, and the good workaround
I suspected something like this, but thought the actual suspension took effect after the Corona applicationSuspend (meaning stuff could be done before the app suspends for real).
Anyway, thanks for the answer, and the good workaround