Forced Synchronization

Under normal conditions, you do not need to instruct the Usage Intelligence SDK when to synchronize with the cloud server, since this happens automatically and is triggered by application interaction with the API. In a typical runtime session, the SDK will always attempt to synchronize with the server at least once whenever the application calls RUISDK.StartSDK. For long running applications, the SDK will periodically sync with the server every 20 minutes.

For applications that require a more customized synchronization, the API also provides an option to request manual synchronization of all cached data. This is done by calling the RUISDK.Sync function.

The RUISDK.Sync function performs a manual synchronization with the Server. In normal operation, the SDK periodically performs automatic synchronizations with the Server. RUISDK.Sync provides the client an ability to explicitly synchronize with the Server on demand. The manual synchronization can request a ReachOut with getReachOut.

Note:Similar to the parameter reachOutOnAutoSync (on function RUISDK.CreateConfig), the ReachOut will not be requested if there is no registered handler (RUISDK and RUISDK.SetReachOutHandler).

RUISDK.Sync can be called between RUISDK.StartSDK and RUISDK.StopSDK and can be called zero or more times.

Note: RUISDK.Sync will not be successful if a New Registration is in progress (i.e. RUISDK.CreateConfig and RUISDK.StartSDK). A manual synchronization with the Server can be associated with RUISDK.StopSDK.

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

RUISDK.Sync

RUIResult RUISDK.Sync (Boolean getReachOut)

Parameters

The RUISDK.Sync function has the following parameters.

RUISDK.Sync Parameters

Parameter

Description

getReachout (bool)

This optional parameter instructs the server whether to send a ReachOut message during this particular sync if available.

Returns

The RUISDK.Sync function returns a RUIResult enum value with the following possible values.

RUISDK.Sync Returns

Return

Description

ok

Function successful.

sdkInternalErrorFatal

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

sdkAborted

A required New Registration has failed, and hence the SDK is aborted. RUISDK.StopSDK and RUISDK destructor are possible.

suspended

Instance has been instructed by Server to back-off. Will return to Running once back-off cleared.

permanentlyDisabled

Instance has been instructed by Server to disable. This is permanent, irrecoverable state.

sdkOptedOut

Instance has been instructed by the application to opt-out.

configNotCreated

Configuration has not been successfully created.

sdkNotStarted

SDK has not been successfully started.

syncAlreadyRunning

A sync with the Server is already running.

sdkAlreadyStopped

SDK has already been successfully stopped.

invalidDoSyncValue

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

timeThresholdNotReached