Stopping the SDK

The stopSDK: function stops the SDK that was started with startSDK. If explicit sessions are allowed (multiSessionsEnabled = true in createConfig), then any sessions that have been started with startSession: that have not been stopped with stopSession: are automatically stopped. A manual synchronization with the Server, sync:, will be performed at stop depending on the value of doSync (as described in Parameters).

stopSDK: must be called after startSDK and must be called only once. After stopSDK: is called, the various event tracking APIs are no longer available. The only APIs available are getState: and the Objective-C instance release. The SDK cannot be re-started with a subsequent call to startSDK.

stopSDK: is a synchronous function, including the manual synchronization with the Server (if requested), returning when all functionality is completed.

stopSDK:

(RUIRESULTOBJC) stopSDK: (int32_t)doSync

Parameters

The stopSDK: function has the following parameters.

stopSDK: Parameters

Parameter

Description

doSync (int32_t)

Determines if the SDK will synchronize with the Server when exiting the SDK. Normally, doSync is set to RUI_SDK_STOP_SYNC_INDEFINITE_WAIT. Possible values are:

1—Do not perform a manual synchronization with the Server as part of the stop. RUI_SDK_STOP_NO_SYNC
0—Perform a manual synchronization with the Server as part of the stop; wait indefinitely for completion. RUI_SDK_STOP_SYNC_INDEFINITE_WAIT
>0—Perform a manual synchronization with the Server as part of the stop; wait only doSync seconds for completion.

Returns

The stopSDK: function returns one of the return status constants below.

stopSDK: Returns

Return

Description

RUI_OK

Function successful.

RUI_SDK_INTERNAL_ERROR_FATAL

Irrecoverable internal fatal error. No further API calls should be made.

RUI_SDK_ABORTED

A required New Registration has failed, and hence the SDK is aborted. stopSDK: and Objective-C instance release are possible.

RUI_CONFIG_NOT_CREATED

Configuration has not been successfully created.

RUI_SDK_NOT_STARTED

SDK has not been successfully started.

RUI_SDK_ALREADY_STOPPED

SDK has already been successfully stopped.

RUI_INVALID_DO_SYNC_VALUE

The doSync manual sync flag/limit violates its allowable range.