How can I change the session length requirements for the App Session event?

By default, Mixpanel tracks an App Session event for session lengths that are only above 10 seconds and with no limit on the maximum session length. We know that this doesn’t always fit the needs of every customer and that every app is different. To customize this behavior, we have added two public properties in our SDKs; minimumSessionLength and maximumSessionLength. In order to set these properties, you initially need to initialize Mixpanel, and then set the properties like so:

Objective-C SDK

Mixpanel *mixpanel = [Mixpanel sharedInstanceWithToken:API_TOKEN]
mixpanel.minimumSessionDuration = 2000; 
//(2000ms which means we set the minimum session duration we track to 2 seconds)
mixpanel.maximumSessionDuration = 1800000; 
//(1800000ms which means we set the maximum session duration we track to 30 minutes)

Swift SDK

var mixpanel = Mixpanel.initialize(token: API_TOKEN)
mixpanel.minimumSessionDuration = 2000 
//(2000ms which means we set the minimum session duration we track to 2 seconds)

Android SDK

The following meta-tags should be included in your AndroidManifest.xml: (values are in ms)

<meta-data android:name="com.mixpanel.android.MPConfig.MinimumSessionDuration"
    android:value="20000" />

<meta-data android:name="com.mixpanel.android.MPConfig.SessionTimeoutDuration"
    android:value="90000" />