Generally, every time a user launches an application, a Session is created. Each Session represents one instance of a user opening the app. When a user closes the app or backgrounds it for more than the session timeout interval (set to 15 seconds for mobile apps and 30 minutes for web apps by default), the Session is then closed. For more, see Analytics Key Concepts from our User Guide.
A sent push notification does not create a new session unless this notification causes the app to open, which then creates a new session.
Specifically, when using
- On Android, sessions are opened/resumed when an activity hits
onStart(), and the timer for session close starts when
onStop()gets hit while no other activities have hit
onStart(). Localytics keeps a running counter internally of calls to
onStop()to do this.
- On iOS sessions are opened/resumed when
applicationWillEnterForegroundis called, and the timer for session close starts when
- On the Web, sessions are opened/resumed when Localytics is initialized on a page, and the timer for session closes starts immediately. Event tags or new page loads that initialize Localytics again reset the session close timer.
Using alternative session management instead of automatic integration allows the developer to control session starts and stops to match their own logic.