Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
menghao
Level 7

Scene Graph App quit event

Is there any way I can just block the quit event for a second? Or any walkaround? I need to detect the quit event at least. I want to log the usage to a remote server, let's say google analytics. For now, as I know, the OnKeyEvent() in the node can not detect the home button pressed. And it seems in the main.brs, the while loop that listens on the messagePort is not working either. It seems that no roSGScreenEvent has happened, the logQuit() was never called.
	while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then
logQuit()
return
end if
end if
end while
0 Kudos
5 Replies
EnTerr
Level 8

Re: Scene Graph App quit event

No, there isn't.
This is not a scenography issue in particular - it's Roku one in general.
There is a suggestion on how to fix that already, see here https://forums.roku.com/viewtopic.php?f ... 30#p487482
Waiting for Roku* to chime in, I suppose. Sheesh, can't believe it's been over a year?!
0 Kudos
Highlighted
menghao
Level 7

Re: Scene Graph App quit event

"EnTerr" wrote:
No, there isn't.
This is not a scenography issue in particular - it's Roku one in general.
There is a suggestion on how to fix that already, see here https://forums.roku.com/viewtopic.php?f ... 30#p487482
Waiting for Roku* to chime in, I suppose. Sheesh, can't believe it's been over a year?!

Thank you EnTerr, the way I can image is that at least I can record the time of the app quit. And try to send usage event when the app restarts next time.
I worked on android TV the leanback library before, they all support the background activities. Hope Roku will think about it. This is a common usage case indeed.
0 Kudos
EnTerr
Level 8

Re: Scene Graph App quit event

"menghao" wrote:
Thank you EnTerr, the way I can image is that at least I can record the time of the app quit. And try to send usage event when the app restarts next time.
I worked on android TV the leanback library before, they all support the background activities.
Umm... "background activities" is one of the big mor-asses of Android, at least for mobile. I wouldn't go there!

Hope Roku will think about it. This is a common usage case indeed.

Most all mobile and media platforms support exit events, indeed. In fact i can't think of one that doesn't.
It's entirely possible Roku already implemented that a year ago, just forgot to tell us, the "little people". It has happened before (cue formatJSON(), some ECP commands, getPng()... ).
0 Kudos
the_mace
Level 7

Re: Scene Graph App quit event

This page is confusing:
https://sdkdocs.roku.com/display/sdkdoc/roSGScreenEvent

It makes it look like you can intercept the close event, but when the home button is pressed the app doesn't get any events
0 Kudos
jaxim
Level 7

Re: Scene Graph App quit event

Have any new developments been made or discovered on this subject?
0 Kudos