Copy link to clipboard
Copied
Hi All,
Does anybody is having any idea that how can we detect the user Idle time in Adobe air based ios mobile application.
For a desktop based air project this can eaisly be defined by the below two events:-
1) flash.events.Event.USER_IDLE
2) flash.events.Event.USER_PRESENT
But its very painfull to know that these events are not going to work with the mobile applications.
If anybody is having any idea,please let me know.
Any help will be appriciated.
with Regards,
Shardul
Copy link to clipboard
Copied
Hi, sorry to bring up such an old post (I just found it while googling), but since it never got an answer, I thought I'd bump it up, because I'm having the exact same problem now. There's really no way to make these events work in iOS, or any valid alternative?
I've filed a feature request in bugbase, just in case this can be fixed. Please vote if you're having the same issue:
https://bugbase.adobe.com/index.cfm?event=bug&id=3648849
Happy belated Christmas 2012! 😉
Copy link to clipboard
Copied
This is possible a possible workaround on mobile. I am currently testing this on iOS.
Use:
import mx.core.FlexGlobals;
import mx.core.mx_internal;
import mx.events.FlexEvent;
import mx.managers.ISystemManager;
systemManager = Application(FlexGlobals.topLevelApplication).systemManager;
systemManager.addEventListener(FlexEvent.IDLE, userIdleHandler);
and then the handler looks something like this:
private function userIdleHandler(e:FlexEvent):void
{
if(e.currentTarget.mx_internal::idleCounter == 300){ //300 = 30 seconds
trace("idle timeout");
//do stuff
}
}
The only real problem Im having with it is that if the user hits the home button and the app suspends, upon resuming the idleCounter is > the threshold number and never gets reset when the user is making touches/presses/clicks.
If you guys refine this post your updates.
Thanks,
Jason