MBXUploadServiceInterface

@protocol MBXUploadServiceInterface

Interface to the Upload service. This interface provides basic functionality that allows uploading to the Mapbox backend.

  • Sends an upload request to the native or custom Upload Service.

    Declaration

    Objective-C

    - (uint64_t)uploadForOptions:(nonnull MBXUploadOptions *)options
                        callback:(nonnull MBXUploadStatusCallback)callback;

    Parameters

    options

    The configuration of the request, including URL and file path.

    callback

    Callback to be called in response to the request for updates.

    Return Value

    ID handle to cancel the upload.

  • Cancels a pending or running upload. In case of success, the result of the HttpResponse in the request’s callback will hold the error RequestCancelled

    Declaration

    Objective-C

    - (void)cancelUploadForId:(uint64_t)id
                     callback:(nonnull MBXResultCallback)callback;

    Parameters

    id

    Handle given by upload() method.

    callback

    Callback to be called after attempt to cancel requests. Use this for error handling related to the id. It does not report if the request gets actually cancelled.