Class: Toybox.Media.SyncDelegate

Overview

A delegate object that the user implements to respond to media sync requests from the system.

This has been deprecated

This enum may be removed after System 9.

See Also:

Since:

API Level 3.0.0

Instance Method Summary collapse

Instance Method Details

isSyncNeeded() as Lang.Boolean

Check if a sync is needed.

Returns:

  • Lang.Boolean
    • When true, a sync is needed

    • When false a sync is not needed and onStartSync will not be called if a sync is triggered for this application

Since:

API Level 3.0.0

onStartSync() as Void

Called when a sync is started by the system.

This method should be used to kick-off the application sync process. This includes any setup required to fetch the data needed to prepare the sync, as well as the initial call to makeWebRequest() to download the first piece of audio content. Note that, when using this method, you must chain your makeWebRequest() calls together manually. Additionally, you must call notifySyncProgress() intermittently to enable sync progress updates to be displayed in the native user interface for the device. Finally, notifySyncComplete() must be called either when the sync has successfully completed, or if an error occurs, so that the device can be properly notified that the sync process is finished.

Since:

API Level 3.0.0

onStopSync() as Void

Called when an active sync is cancelled.

This method will be called when an active sync is being cancelled by the user. The app is responsible for calling the cancelAllRequests() to cancel any requests made for a sync process. The app is also responsible to let the system know that sync has successfully been cancelled by calling notifySyncComplete().

Since:

API Level 3.0.0


Generated Mar 18, 2024 2:40:12 PM