Stopping a Session
The stopSession() function stops an explicit session started with startSession().
Explicit sessions are allowed only if createConfig() was called with multiSessionEnabled = true. Any explicit sessions not ended with a call to stopSession() are automatically ended when stopSDK() is called. In case this method is never called, eventually this session will be considered as “timed-out”, and the time of the last recorded event will be assumed to be the time when the last event was recorded.
stopSession() can be called between startSDK() and stopSDK(), and can be called zero or more times.
stopSession() is a synchronous function, returning when all functionality is completed.
RUIResult stopSession(String sessionID)
Parameters
The stopSession() function has the following parameters.
Parameter |
Description |
sessionID (String) |
This parameter should contain a unique ID that refers to the user session that is being stopped. This must be the same ID that was used earlier when calling startSession(). |
Returns
The stopSession() function returns an RUIResult enum value with the following possible values:.
Return |
Description |
OK |
Synchronous functionality successful. |
SDK_INTERNAL_ERROR_FATAL |
Irrecoverable internal fatal error. No further API calls should be made. |
SDK_ABORTED |
A required New Registration has failed, and hence the SDK is aborted. stopSDK() is possible. |
SDK_PERMANENTLY_DISABLED |
The Server has instructed a permanent disable. |
SDK_SUSPENDED |
The Server has instructed a temporary back-off. |
SDK_OPTED_OUT |
Instance has been instructed by the application to opt-out. |
CONFIG_NOT_CREATED |
Configuration has not been successfully created. |
SDK_NOT_STARTED |
SDK has not been successfully started. |
SDK_ALREADY_STOPPED |
SDK has already been successfully stopped. |
INVALID_SESSION_ID_EXPECTED_NON_EMPTY |
The sessionID is expected to be non-empty, and it was not. |
INVALID_SESSION_ID_TOO_SHORT |
The sessionID violates its allowable minimum length. |
INVALID_SESSION_ID_TOO_LONG |
The sessionID violates its allowable maximum length. |
INVALID_SESSION_ID_NOT_ACTIVE |
The sessionID is not currently in use. |