DownloadRegionsStatusListener

public protocol DownloadRegionsStatusListener : AnyObject

Protocol to get notified on status updates when downloading map regions.

  • Called after the download for all requested regions has been completed with success or failure. In this callback, failure represents non-retryable error (eg. authentication failure because of invalid credentials and similars). Temporary failures (eg. network errors) are notified through onPause(...) and downloads will be in paused state so they can be resumed later. Invoked on the main thread.

    Declaration

    Swift

    func onDownloadRegionsComplete(error: MapLoaderError?, regions: [RegionId]?)

    Parameters

    error

    Represents an error in case of a failure. It is nil for an operation that succeeds.

    regions

    Represents a list of regions which has been downloaded. It is nil in case of an error.

  • Called multiple times to indicate the download progress for each requested region individually. Invoked on the main thread.

    Declaration

    Swift

    func onProgress(region: RegionId, percentage: Int32)

    Parameters

    region

    Represents an id of region status update is related to.

    percentage

    Represents a percentage of data which has been downloaded for particular region.

  • Called when download is paused.

    Declaration

    Swift

    func onPause(error: MapLoaderError?)

    Parameters

    error

    Populated when retryable error is a reason of a pause. It is ‘null’ when pause is called by the user.

  • Called when paused download is resumed.

    Declaration

    Swift

    func onResume()