Skip to content

Support for "Application Foregrounded" Events #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
seanrucker opened this issue Nov 8, 2022 · 0 comments · Fixed by #173
Closed

Support for "Application Foregrounded" Events #172

seanrucker opened this issue Nov 8, 2022 · 0 comments · Fixed by #173
Assignees
Labels

Comments

@seanrucker
Copy link
Contributor

The SDK automatically tracks lifecycle events, including an "Application Backgrounded" event in the applicationDidResignActive hook. In the corresponding applicationDidBecomeActive hook, the current implementation uses a flag to track an "Application Opened" event the first time it is called (which makes sense) but there is no event tracked on every call of applicationDidBecomeActive.

I am proposing there should be an equivalent "Application Foregrounded" event that is tracked every time applicationDidBecomeActive is called.

The pair of these two events would provide accurate "bookends" for session time tracking in various analytics platforms. I am using Mixpanel and from their documentation you can see we need to supply a "Session Start Event" and a "Session End Event".

https://help.mixpanel.com/hc/en-us/articles/115004695223

There are other ways to track session time (at least in Mixpanel) using a timeout but this approach is less accurate and event then, without an "Application Foregrounded" event there isn't a guaranteed accurate way to signal the beginning of a session.

We need this on macOS and iOS which both seem to have a similar implementation in the applicationDidBecomeActive and appears to be a trivial addition. I can't speak for Linux or watchOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants