Skip to content
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

fix: improvements to app lifecycle monitoring #243

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

crleona
Copy link
Collaborator

@crleona crleona commented Nov 14, 2024

Summary

Fixes logic around app lifecycle tracking, to improve reliability of session, app opened, and app installed / updated events.

  • If the app is already in the active state when the SDK is initialized, we will automatically fire app installed events and start a new session. This seems to be much closer to the expected behavior.
  • App installed / updated events now only work with version numbers, not last event time, which may already be set by an event.
  • Only send app install events once per instance name, in case we are re-initialized.
  • Capture app delegate at time of use, not initialization, as it may not be set at the time we are initialized.
  • Detects implicit scene configurations from info.plist, which will also opt in to willEnterForeground vs didBecomeActive for initial launch detection.
  • misc cleanup

With this change, we do expect that applications that re-initialize the SDK during the app lifecycle may receive spurious app opened events if they re-initialize the SDK while in the foreground. We could add a flag to revert to the previous behavior or try to be smarter about session tracking (and try to guarantee one app open per foreground, though I'm not sure how much we can do if we aren't initialized).

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: no

@crleona crleona requested a review from a team November 14, 2024 18:46
@crleona crleona merged commit 8098782 into main Nov 14, 2024
8 checks passed
@crleona crleona deleted the fix_app_lifecycle_monitoring branch November 14, 2024 19:16
github-actions bot pushed a commit that referenced this pull request Nov 14, 2024
## [1.10.4](v1.10.3...v1.10.4) (2024-11-14)

### Bug Fixes

* improvements to app lifecycle monitoring ([#243](#243)) ([8098782](8098782))
Copy link

🎉 This PR is included in version 1.10.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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 this pull request may close these issues.

2 participants