Hello!
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.
GA: Submitting custom event(s): 'design': { event\_id='system:suspend' } - Server response: {"status":"ok"} GA: Submitting custom event(s): 'design': { event\_id='system:resume' } - Server response: {"status":"ok"}
Is it a bug?
I also sometimes have the suspend event fired twice, but that is another matter.
Thanks