sync Namespace
The sync Namespace implements the Sync API. It contains the following API elements.
Functions
The sync Namespace contains the following functions.
sync.getPendingAcknowledgement
This API is used to fetch pending acknowledgment for all objects.
Syntax
sync.getPendingAcknowledgement (successCallback, errorCallback)
Input Parameters
Parameter | Description |
---|---|
successCallback [function] - Optional | Specifies the function which will get invoked on success. |
errorCallback [function] - Optional | Specifies the function which will get invoked on error. |
Example
Platform Availability
Available on all platforms.
sync.getPendingUpload
This API fetches all the rows for all objects those are pending for upload.
Syntax
sync.getPendingUpload (successCallback, errorCallback)
Input Parameters
Parameter | Description |
---|---|
successCallback [function] - Optional | Specifies the function which will get invoked on success. |
errorCallback [function] - Optional | Specifies the function which will get invoked on error. |
Example
Platform Availability
Available on all platforms.
sync.init
This API is used to initialize the creation of device database for sync.
Syntax
sync.init (initSuccessCallback , initFailCallback)
Input Parameters
Parameter | Description |
---|---|
initSuccessCallback [function] - Optional | Specifies the function which will get invoked on success. |
initFailCallback [function] - Optional | Specifies the function which will get invoked on failure. |
Example
Platform Availability
Available on all platforms
sync.reset
This API is used to reset the device database to initial state. This API will remove all data from the database.
Syntax
sync.reset (successCallback, errorCallback)
Input Parameters
Parameter | Description |
---|---|
successCallback [function] - Optional | Specifies the function which will get invoked on success. |
errorCallback [function] - Optional | Specifies the function which will get invoked on error. |
Example
Platform Availability
Available on all platforms.
sync.rollbackPendingLocalChanges
This API is used to roll back the application level pending changes which are not synchronized.
Syntax
sync.rollbackPendingLocalChanges (successCallback, errorCallback)
Input Parameters
Parameter | Description |
---|---|
successCallback [function] - Optional | Specifies the function which will get invoked on success. |
errorCallback [function] - Optional | Specifies the function which will get invoked on error. |
Example
Platform Availability
Available on all platforms.
sync.startSession
This API is used to start the sync process and download the data from the Enterprise Data Source to the device database.
Syntax
sync.startSession(config)
Input Parameters
Parameter | Description |
---|---|
config [table] - Mandatory | Specifies the table to set the configuration parameters. |
Example
Platform Availability
Available on all platforms.