API: Check Dropbox Status
This JavaScript API works with our Dropbox integration to allow you to check the status of sync operations, trigger a sync if you feel one is needed and track the progress of current sync operations. This API also allows you to start or stop syncing of files located either in Dropbox or on the device, limiting the amount of bandwidth used by the automatic Dropbox sync process.
While Kiosk Pro's Dropbox integration is designed to work automatically, triggering a new sync whenever changes are made to files, this API gives additional controls and visibility into that process.
Requirements
- Integration of our JavaScript API into your webpage
- Sample code to run within the app and download for integration into your own project is available here.
- Best practices for working with the JavaScript API are available here.
- App Settings
- Content > JavaScript API > Access JavaScript API = By Import
- Dropbox Sync
- Enable = On
- Account Information = must be linked to your Dropbox account
Triggers via API Functions
Check Dropbox Sync Status
This function checks the current sync status of Dropbox's servers and, if needed, syncs any files that are not current.
Format | kp_DBXSyncManager_sync(); |
Triggers | This call triggers kp_DBXSyncManager_syncOperationDidSchedule when checking the sync status begins. If a sync is needed, this call will then trigger a sync and track the sync using the callbacks kp_DBXSyncManager_syncOperationDidStart and kp_DBXSyncManager_syncOperationDidFinish. |
Allow Specific Files to Sync
This function prevents files stored in a specific location from triggering a sync cycle or being synced.
Format | kp_DBXSyncManager_startObservingChangesOfType(type); |
Parameters |
|
Prevent Specific Files from Syncing
This function prevents files stored in a specific location from triggering a sync cycle or being synced.
Format | kp_DBXSyncManager_stopObservingChangesOfType(type); |
Parameters |
|
Check Sync Status of Specific Files
This function triggers a callback to check whether certain files are being synced.
Format | kp_DBXSyncManager_getTypeOfObservingChanges(callback); |
Parameters | callback = [string] callback name |
Callback Format | callback(type); |
Return Values |
|
Notifications via API Callbacks
When a Sync Status Check is Triggered
This callback is triggered whenever a check of sync status is started either automatically by the app in response to changes in files stored in Dropbox or the Unique Content folder on the device or through kp_DBXSyncManager_sync.
Format | kp_DBXSyncManager_getTypeOfObservingChanges(isScheduled); |
Return Values |
|
When Syncing Starts
This callback indicates a sync cycle has started and provides information on the files to be synced.
Format | kp_DBXSyncManager_syncOperationDidStart(arrayOfJobs); |
Return Values |
|
When Syncing End
This callback indicates a sync cycle has completed and provides information on the files to be synced. As the kiosk is designed to refresh after new content is synced to the device so as to display any new content, you may not see the sync did finish event in every case.
Format | kp_DBXSyncManager_syncOperationDidFinish(arrayOfJobs); |
Return Values |
|
Sample Code
- This sample code relies on the JavaScript APIs built into Kiosk Pro and will not run successfully in other browsers or within our in-app help interface.
- To run sample code, set the app's homepage to https://kioskgroup.com/dropbox-api
- To download a .zip of sample code, click here.
Change Log
- Added in version 3.5.2.