Server

public class Server : ModelObject

Representation of an Usher Server.

  • URL of the server

    Declaration

    Swift

    @objc
    public private(set) dynamic var serverURL: String
  • Name of the server

    Declaration

    Swift

    @objc
    public private(set) dynamic var serverName: String
  • Version of the server

    Declaration

    Swift

    @objc
    public private(set) dynamic var serverVersion: String
  • Customer support email address

    Declaration

    Swift

    @objc
    public private(set) dynamic var supportEmail: String
  • Customer support email label (For UI display purposes)

    Declaration

    Swift

    @objc
    public private(set) dynamic var supportEmailLabel: String
  • Customer support phone number

    Declaration

    Swift

    @objc
    public private(set) dynamic var supportPhone: String
  • Customer support phone label (For UI display purposes)

    Declaration

    Swift

    @objc
    public private(set) dynamic var supportPhoneLabel: String
  • Customer feedback email address

    Declaration

    Swift

    @objc
    public private(set) dynamic var feedBackEmail: String
  • Customer feedback email label (For UI display purposes)

    Declaration

    Swift

    @objc
    public private(set) dynamic var feedbackEmailLabel: String
  • Number of badges installed from the server on the current device.

    Declaration

    Swift

    @objc
    public internal(set) dynamic var badgeCount: Int
  • Boolean that indicates if the server is the default one on the current device.

    Declaration

    Swift

    @objc
    public internal(set) dynamic var isDefault: Bool
  • Initializes a server object

    Declaration

    Swift

    @objc
    public convenience init(name: String, url: String, accessToken: String? = nil, refreshToken: String? = nil)
    Parameters
    name

    The server name

    url

    The server URL string (including port number if any)

    accessToken

    Server access token.

    refreshToken

    Server refresh token.

  • Compares if the server version is the same or higher than the provided server version

    Declaration

    Swift

    public func serverVersionAtLeast(version: String) -> Bool
    Parameters
    version

    Server version string

    Return Value

    true if the current server version is same or higher than the provided server version.

  • Miniature dictionary representation of a server object for a watch app.

    Declaration

    Swift

    public func dataForWatch() -> [String : Any]
    Return Value

    Dictionary with values for accessToken, serverURL, serverName and type

  • Store the server informatin into cache

    Declaration

    Swift

    public func save()