27 Jun 2012 8:07 AM #1
Will Sencha Native Build provide onPause and onResume events?
Hi! I have been using ST1 + Phonegap in the past, but at the moment I am trying to get the most out of Sencha Touch 2 + Native Building. Because of the nature of the app that I am writing it is mandatory that the app 'logs the user off' when it has been in the background for more than 5 minutes. In the past I just assigned the current date to a variable onPause and compared it to the timestamp in onResume. If the difference was more than 5 minutes => lock.
I know that Sencha uses the onPause and onResume internally for solving the iOS LocalStorage bug, but I would like to know whether I can access these events from the JS-part of Sencha. Can a source-code-fanatic or developer shed some light on this?
Thanks in advance!
27 Jun 2012 2:23 PM #2
just use these listeners:
document.addEventListener("pause", yourCallbackFunction,false); document.addEventListener("resume", yourCallbackFunction, false);
28 Jun 2012 3:12 AM #3
28 Jun 2012 1:26 PM #5
18 Oct 2012 6:20 AM #6
I would also like to access the onPause and onResume event, to reload a store that might have changed while the app is paused.
Did you figure out a way to do it?
7 Dec 2012 12:51 AM #7
Any update on this from the Sencha team?
Can someone please put a reference to any documentation/article (hopefully there is such documentation) that describes the way Sencha behaves on 'pause' & 'resume' events?