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
apiKeyYour account’s API key
baseUrlThe base URL for Barracks, if you have set one up
ignoreSSLFlag to ignore SSL certificate check
-
This method is used to check wether an update is available on the Barracks service.
Declaration
Swift
public func checkUpdate(_ request:UpdateCheckRequest, callback:UpdateCheckCallback)Parameters
requestThe
UpdateCheckRequestused to perform the checkcallbackThe
UpdateCheckCallbackcalled during the process
-
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
responseThe
UpdateCheckResponseretrieved usingBarracksClient.checkUpdate(_:callback:)callbackThe
PackageDownloadCallbackwhich will be called during the processdestinationThe optional destination for the update package on the filesystem
View on GitHub
Install in Dash
BarracksClient Class Reference