PusherClientOptions

public struct PusherClientOptions

A collection of configuration options for a Pusher Channels HTTP API client.

  • The application identifier (as specified in the Channels developer dashboard).

    Declaration

    Swift

    public let appId: Int
  • key

    The application key (as specified in the Channels developer dashboard).

    Declaration

    Swift

    public let key: String
  • The application secret (as specified in the Channels developer dashboard).

    Declaration

    Swift

    public let secret: String
  • The master key used for server-side encryption operations.

    The master key is never shared with Pusher and should be kept secret. It should be a Base-64 encoded String of 32 bytes of random data. An example command for generating such a key is: "openssl rand -base64 32".

    Declaration

    Swift

    public let encryptionMasterKey: String
  • The Pusher cluster that hosts the Channels application (as specified in the Channels developer dashboard).

    This will be nil if a custom host is provided.

    Declaration

    Swift

    public let cluster: String?
  • The host of the Channels application.

    Declaration

    Swift

    public let host: String
  • A HTTP proxy to use when routing traffic to a custom host.

    The default value is nil.

    Declaration

    Swift

    public let httpProxy: String?
  • The port to use when routing traffic to the host.

    Declaration

    Swift

    public let port: Int
  • The scheme to use when routing traffic to the host.

    Declaration

    Swift

    public let scheme: String
  • Whether or not Transport Layer Security is used when sending and receiving traffic to and from the host.

    The default value is true.

    Declaration

    Swift

    public let useTLS: Bool

Lifecycle

  • Creates a PusherClientOptions instance using the default set of configuration options provided by the Pusher Channels developer dashboard.

    Throws

    A PusherError if the configuration options are invalid for some reason.

    Declaration

    Swift

    public init(appId: Int,
                key: String,
                secret: String,
                encryptionMasterKey: String,
                cluster: String,
                useTLS: Bool = true) throws

    Parameters

    appId

    The application identifier (as specified in the Channels developer dashboard).

    key

    The application key (as specified in the Channels developer dashboard).

    secret

    The application secret (as specified in the Channels developer dashboard).

    encryptionMasterKey

    The master key used for server-side encryption operations. (Refer to encryptionMasterKey for information on its expected format).

    cluster

    The Pusher cluster that hosts the Channels application (as specified in the Channels developer dashboard).

    useTLS

    Whether or not Transport Layer Security is used when sending and receiving traffic to and from the host. The default value is true.

  • Creates a PusherClientOptions instance from a collection of configuration options.

    Throws

    A PusherError if the configuration options are invalid for some reason.

    Declaration

    Swift

    public init(appId: Int,
                key: String,
                secret: String,
                encryptionMasterKey: String,
                cluster: String? = nil,
                host: String? = nil,
                httpProxy: String? = nil,
                port: Int? = nil,
                scheme: String? = nil,
                useTLS: Bool = true) throws

    Parameters

    appId

    The application identifier (as specified in the Channels developer dashboard).

    key

    The application key (as specified in the Channels developer dashboard).

    secret

    The application secret (as specified in the Channels developer dashboard).

    encryptionMasterKey

    The master key used for server-side encryption operations. (Refer to encryptionMasterKey for information on its expected format).

    cluster

    The Pusher cluster that hosts the Channels application (as specified in the Channels developer dashboard). The default value is nil.

    host

    A custom host for a Channels application (e.g. "myhost.com"). The default value is nil.

    httpProxy

    A HTTP proxy to use when routing traffic to a custom host. The default value is nil.

    port

    A port to use when routing traffic to a custom host. The default value is nil.

    scheme

    A scheme to use when routing traffic to a custom host. The default value is nil.

    useTLS

    Whether or not Transport Layer Security is used when sending and receiving traffic to and from the host. The default value is true.