Last modified January 14, 2021 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.


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.

- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  SwrveConfig* config = [[SwrveConfig alloc] init];
  config.newSessionInterval = 30;    // seconds

  [Swrve sharedInstanceWithAppID:<app_id> apiKey:@"<api_key>" config:config];


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:

public class YourApplication extends Application {
   public void onCreate() {
       try {
           SwrveConfig config = new SwrveConfig();
           config.newSessionInterval = 30000; // milliseconds
           SwrveSDK.createInstance(this, <app_id> , "<api_key>", config);
       } catch (IllegalArgumentException exp) {
           Log.e("SwrveDemo", "Could not initialize the Swrve SDK", exp);


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


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

sdk.Config.NewConfigInterval = 30; // seconds


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

screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
scene = screen.CreateScene("YourSceneName") = screen.getGlobalNode() = "GlobalNode"

swrveConfig = { appId: "<app_id>",
                apikey: "<api_key>",
                userid: "<user_id>",
                newSessionInterval: 30 'represented in seconds'

swrveClient = Swrve(swrveConfig, m.port)