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.


(RUIRESULTOBJC) stopSDK: (int32_t)doSync


The stopSDK: function has the following parameters.

stopSDK: Parameters



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.


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

stopSDK: Returns




Function successful.


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


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


Configuration has not been successfully created.


SDK has not been successfully started.


SDK has already been successfully stopped.


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