Skip to main content
Skip table of contents

VMS initialization

Uses Alamofire of 4.8.2 version.

Main entry point to establish connection between application and server.


For simple initialization only url of your server is required

import VMSMobileSDK

let apiUrl = ""
var api = VMS(
        baseUrl: apiUrl,
        language: nil,
        accessToken: nil
    api.delegate = self


For now we support only two languages

public enum VMSLanguage: String {
    case russian = "ru"
    case english = "en"

Access token

For authorised users you can set user's access token. In this case you can skip authorization flow. Otherwise SDK will set this parameter by itself after login request.


Set delegate if you want to handle errors. Here you will receive all possible errors, but we suggest additionally handle 422 and 429 inside requests. See ApiError for more details.

public protocol VMSDelegate: AnyObject {
    func apiDidReceiveError(_ error: VMSApiError)

Download archive

Part of video will be downloaded from url and saved.

func downloadArchiveRequest(
    url: URL,
    destinationUrl: URL,
    progressHandler: @escaping ((Progress) -> Void),
    completionHandler: @escaping ((Error?) -> Void)

url - from where download archive

destinationUrl - where to save downloaded file

progressHandler - track the progress of downloading process

completionHandler - will be called when download is finished

Cancel download archive request


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.