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];
- (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];
...
}
- (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 {
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);
public class YourApplication extends Application {
@Override
public void onCreate() {
super.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);
}
}
}
public class YourApplication extends Application {
@Override
public void onCreate() {
super.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
sdk.Config.NewConfigInterval = 30; // seconds
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")
screen.setMessagePort(m.port)
scene = screen.CreateScene("YourSceneName")
m.global = screen.getGlobalNode()
m.global.id = "GlobalNode"
swrveConfig = { appId: "<app_id>",
newSessionInterval: 30 'represented in seconds'
swrveClient = Swrve(swrveConfig, m.port)
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("YourSceneName")
m.global = screen.getGlobalNode()
m.global.id = "GlobalNode"
swrveConfig = { appId: "<app_id>",
apikey: "<api_key>",
userid: "<user_id>",
newSessionInterval: 30 'represented in seconds'
}
swrveClient = Swrve(swrveConfig, m.port)
screen.show()
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("YourSceneName")
m.global = screen.getGlobalNode()
m.global.id = "GlobalNode"
swrveConfig = { appId: "<app_id>",
apikey: "<api_key>",
userid: "<user_id>",
newSessionInterval: 30 'represented in seconds'
}
swrveClient = Swrve(swrveConfig, m.port)
screen.show()