Starting the SDK

The ruiStartSDK() function starts the SDK. ruiStartSDK() must be paired with a call to ruiStopSDK().

After the SDK is started, the various event tracking APIs are available to be used. If ruiCreateConfig() did not detect a configuration file, ruiStartSDK() will perform a New Registration with the Server. Until a New Registration is complete, the SDK will not be able to save event data to a log file or perform synchronization with the Server. A successful New Registration (or presence of a configuration file) will put the SDK into a normal running state, whereby events are saved to a log file, automatic and manual synchronizations with the Server are possible, and getting ReachOut campaigns from the Server are possible. A failed New Registration will put the SDK into an aborted state, not allowing further activity.

ruiStartSDK() must be called after ruiCreateConfig(), and must be called only once.

ruiStartSDK() is an asynchronous function, returning immediately with further functionality executed on separate thread(s).

If ruiOptOut() is called before a new registration has been done for a user, the SDK will not sync any system and product information and no data is recorded for the user. The SDK will inform the server once that there is an opted out user for reporting opt-out statistics only.

ruiStartSDK()

RUIRESULT ruiStartSDK(RUIINSTANCE* ruiInstance)

Parameters

The ruiStartSDK() function has the following parameters.

ruiStartSDK() Parameters

Parameter

Description

ruiInstance (RUIINSTANCE*)

Pointer to the RUI instance created via ruiCreateInstance().

Returns

The ruiStartSDK() function returns one of the return status constants below.

ruiStartSDK() Returns

Return

Description

RUI_OK

Synchronous functionality successful.

RUI_INVALID_SDK_OBJECT

SDK Instance parameter is NULL or invalid.

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. ruiStopSDK() and ruiDestroyInstance() are possible.

RUI_SDK_PERMANENTLY_DISABLED

The Server has instructed a permanent disable.

RUI_CONFIG_NOT_CREATED

Configuration has not been successfully created.

RUI_SDK_ALREADY_STARTED

SDK has already been successfully started.

RUI_SDK_ALREADY_STOPPED

SDK has already been successfully stopped.