bosborne
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2013
07:26 PM
Detect when app closed
I'm looking to add some analytics tracking an application and need to track a session start / session end. Session start is easy. But how can I detect when a users closes the app? Do I have any chance to run code before the app actually closes? I'd like to send a session end beacon in that case.
32 REPLIES 32
RokuChris
Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2013
10:50 AM
Re: Detect when app closed
"bosborne" wrote:
I'm looking to add some analytics tracking an application and need to track a session start / session end. Session start is easy. But how can I detect when a users closes the app? Do I have any chance to run code before the app actually closes? I'd like to send a session end beacon in that case.
When the user presses the Home button the channel will exit immediately and return to the Roku home screen. There's no way to detect the Home button.
http://sdkdocs.roku.com/display/sdkdoc/ ... -LevelMenu
bosborne
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2013
10:51 AM
Re: Detect when app closed
That is what I expected. Thanks
RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2013
12:17 PM
Re: Detect when app closed
On older devices, firmware 3.1 you might be able to get away with kicking off an http event on msg.isScreenClosed() when the home button is pressed.
- Joel
- Joel
bosborne
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2014
07:26 AM
Re: Detect when app closed
Just checking in no this again to make sure support for the home button press hasn't been added? Like giving a little time to "cleanup" certain things.
tvjay
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2014
07:13 PM
Re: Detect when app closed
How do end a session then if you can't track the home button?
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2014
11:30 PM
Re: Detect when app closed
Most 'solutions' for this functionality will be ugly clutches - like polling the server at set intervals to 'keep alive'. Most of the time we simply settle for logging button presses or specific activity.
bathejasumeet
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2015
04:51 AM
Re: Detect when app closed
I have ran into a similar situation now, only possible solution I see is a timed event firing to capture event in analytics , but that would cause flooding and complex filtering logic at the part where events are received.
Rek
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2015
02:39 PM
Re: Detect when app closed
"RokuJoel" wrote:
On older devices, firmware 3.1 you might be able to get away with kicking off an http event on msg.isScreenClosed() when the home button is pressed.
- Joel
Can you offer some insight as to why there is no callback to the application when closing? I would love to have this in my own app, and I'm sure there are many developers who feel the same.
TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2015
05:28 PM
Re: Detect when app closed
"Rek" wrote:"RokuJoel" wrote:
On older devices, firmware 3.1 you might be able to get away with kicking off an http event on msg.isScreenClosed() when the home button is pressed.
- Joel
Can you offer some insight as to why there is no callback to the application when closing? I would love to have this in my own app, and I'm sure there are many developers who feel the same.
If I recall correctly, the original explanation was that it was to prevent channels from hanging the box indefinitely by including bad code in the close event.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)