Last modified May 22, 2018 by Shelly Wolfe

How do I configure the New Session Interval?

Swrve treats an app session as a new session if the user returns to the app after having left it for 30 seconds, by default. However, you can configure the new session interval of 30 seconds using the newSessionInterval config property. You may want to extend it to several minutes to facilitate users taking longer breaks from the app, without incrementing session counts. For more details on how to customize this setting, click the relevant tab below.

iOS

Customizing the new session interval in the native iOS SDK requires at least v4.0.1 of the iOS SDK. For the latest version of the iOS SDK, see iOS SDK release notes.

In iOS, the newSessionInterval is measured in seconds. Update the didFinishLaunchingWithOptions method of your application with the following, and substitute 30 with the value of your choice.

Android

In Android, the newSessionInterval is measured in milliseconds. Update the onCreate method of your application with the following, and substitute 30000 with the value of your choice:

Unity

In the Unity editor, enter a new value (in seconds), in the the New Session Interval field:

NewSessionInterval_Unity

Alternatively, to configure this value directly in the code, modify the NewSessionInterval property of your configuration object as follows:

Roku

In Roku, the newSessionInterval is measured in seconds. Update your swrveConfig with the following, and substitute 30 with the value of your choice.