Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
menghao
Visitor

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 5
EnTerr
Roku Guru

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
menghao
Visitor

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
Roku Guru

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
Channel Surfer

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
Visitor

Re: Scene Graph App quit event

Have any new developments been made or discovered on this subject?
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.