Starting the SDK
The startSDK() function starts the SDK. startSDK() must be paired with a call to stopSDK().
After the SDK is started, the various event tracking APIs are available to be used. If createConfig() did not detect a configuration file, startSDK() 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.
startSDK() must be called after createConfig(), and must be called only once.
startSDK() is an asynchronous function, returning immediately with further functionality executed on separate thread(s).
If optOut() 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.
RUIResult startSDK()
Returns
The startSDK() function returns a 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. |
CONFIG_NOT_CREATED |
Configuration has not been successfully created. |
SDK_ALREADY_STARTED |
SDK has already been successfully started. |
SDK_ALREADY_STOPPED |
SDK has already been successfully stopped. |