BarracksClient

open class BarracksClient

The main entry point for using Barracks’ SDK. This class provides methods to help you getting information about the available updates for a specific configuration.

  • Network Session Manager

    Declaration

    Swift

    public var networkSessionManager:SessionManager
  • Create a client using the parameters provided by the Barracks platform.

    Declaration

    Swift

    public init(_ apiKey:String, baseUrl:String = "https://app.barracks.io/api/device/update/check", ignoreSSL:Bool = false)

    Parameters

    apiKey

    Your account’s API key

    baseUrl

    The base URL for Barracks, if you have set one up

    ignoreSSL

    Flag to ignore SSL certificate check

  • This method is used to download an update package from the Barracks service.

    Declaration

    Swift

    public func downloadPackage(_ response:UpdateCheckResponse, callback:PackageDownloadCallback, destination:String? = nil)

    Parameters

    response

    The UpdateCheckResponse retrieved using BarracksClient.checkUpdate(_:callback:)

    callback

    The PackageDownloadCallback which will be called during the process

    destination

    The optional destination for the update package on the filesystem