Closed GoogleCodeExporter closed 9 years ago
the way the IdleTimer is implemented is far from ideal
todo
- create a new IdleTimer from scratch
- provide options/hooks to control it
some scenarios:
1) you have an AIR app which need to end the current tracking session when it
goes "idle"
in this case the IdleTimer of gaforflash should be able to be controlled from
the AIR app
to have the idle/non-idle cycle in sync
2) for a mobile app you can be in the situation to lose the focus and run in
the background
this is not really being "idle", this is being "paused" and should require a
"resume"
when gaining again the focus
3) for a desktop app (especially with multiscreens) your app can also "lose the
focus"
the user does not close the app but is just focusing on another screen
this could also require a "pause" and "resume" mecanism
but we could also consider each "lost of focus" as "closing the app"
the point is the user of the gaforflash lib need to be able to control
those behaviours with some config/options/etc.
Original comment by zwetan
on 23 Feb 2012 at 12:41
note: a quick workaround is to create the instance of GATracker and inititalize
it
when the ADDED_TO_STAGE event is received
the problem:
you create the instance
----
GATracker.autobuild = false;
tracker = new GATracker( this, "UA-ID-000" );
tracker.mode = TrackerMode.AS3;
tracker.config.sessionTimeout = 60;
tracker.config.conversionTimeout = 180;
----
and after you receive ADDED_TO_STAGE
you initialize the lib
----
GATracker(tracker).build();
----
between the two
by the time the ADDED_TO_STAGE event is fired
(if your app do a lot of inititalization)
that's where the IdleTimer can occurs
the workaround:
but if you do both after you receive ADDED_TO_STAGE
----
GATracker.autobuild = false;
tracker = new GATracker( this, "UA-ID-000" );
tracker.mode = TrackerMode.AS3;
tracker.config.sessionTimeout = 60;
tracker.config.conversionTimeout = 180;
GATracker(tracker).build();
----
no room for error as the stage reference is there
why it should not happen:
"autobuild = false" should allow to delay the initialization of the lib early
(eg. way before ADDED_TO_STAGE occurs)
Original comment by zwetan
on 23 Feb 2012 at 12:55
the IdleTimer will be completely removed for the following different reasons
- as of now, the IdleTimer listen the Stage for MouseEvent.MOUSE_MOVE events
if you use gaforflash for mobile and other app using touch/gesture
the "idle timer" would still kick which is bad
- it is preferable to give the control of a "timer" to the user instead of
trying
to deal with all different case from within the library
Original comment by zwetan
on 14 Apr 2012 at 9:28
Original comment by zwetan
on 30 Apr 2012 at 9:57
Original issue reported on code.google.com by
zwetan
on 23 Feb 2012 at 12:27