Properties

Link copied to clipboard
abstract val authKey: String

If Access Manager V2(deprecated PAM v2) is utilized, client will use this authKey in all restricted requests.

Link copied to clipboard
abstract val cacheBusting: Boolean

If operating behind a misbehaving proxy, allow the client to shuffle the subdomains.

Link copied to clipboard
abstract val certificatePinner: CertificatePinner?
Link copied to clipboard

How long to keep idle connections alive in the OkHttp connection pool before evicting them.

Link copied to clipboard

Maximum number of idle connections to keep in the OkHttp connection pool.

Link copied to clipboard
abstract val connectionSpec: ConnectionSpec?
Link copied to clipboard
abstract val connectTimeout: Int

How long before the client gives up trying to connect with the server.

Link copied to clipboard
abstract val cryptoModule: CryptoModule?

CryptoModule is responsible for handling encryption and decryption. If set, all communications to and from PubNub will be encrypted.

Link copied to clipboard

Custom loggers list for creating additional logger instances. Use it if your slf4j implementation like logback, log4j2, etc. can't meet your specific logging requirements.

Link copied to clipboard
Link copied to clipboard

How many times publishing file message should automatically retry before marking the action as failed

Link copied to clipboard
abstract val filterExpression: String

Feature to subscribe with a custom filter expression.

Link copied to clipboard

Enable Google App Engine networking.

Link copied to clipboard
abstract val heartbeatInterval: Int

How often the client will announce itself to server.

Link copied to clipboard

Set Heartbeat notification options.

Link copied to clipboard
Link copied to clipboard
abstract val httpLoggingInterceptor: HttpLoggingInterceptor?

Sets a custom HttpLoggingInterceptor for logging network traffic.

Link copied to clipboard

Whether to include a instanceId with every request.

Link copied to clipboard

Whether to include a requestId with every request.

Link copied to clipboard

Set to PNLogVerbosity.BODY to enable logging of network traffic, otherwise se to PNLogVerbosity.NONE.

Link copied to clipboard

When true the SDK will resend the last channel state that was set using PubNub.setPresenceState for the current userId with every automatic heartbeat (if heartbeatInterval is greater than 0) and initial subscribe connection (also after e.g. loss of network).

Link copied to clipboard

Enables explicit presence control. When set to true heartbeat calls will contain only channels and groups added explicitly using PubNubCore.presence. Should be used only with ACL set on the server side. For more information please contact PubNub support

Link copied to clipboard
abstract val maximumConnections: Int?
Link copied to clipboard
Link copied to clipboard

For non subscribe operations (publish, herenow, etc), This property relates to a read timeout that is applied from the moment the connection between a client and the server has been successfully established. It defines a maximum time of inactivity between two data packets when waiting for the server’s response.

Link copied to clipboard

For non subscribe operations (publish, herenow, etc), This property relates to a read timeout that is applied from the moment the connection between a client and the server has been successfully established. It defines a maximum time of inactivity between two data packets when waiting for the server’s response.

Link copied to clipboard
abstract val origin: String

Custom origin if needed.

Link copied to clipboard
abstract val pnsdkSuffixes: Map<String, String>
Link copied to clipboard
abstract val presenceTimeout: Int

Sets the custom presence server timeout.

Link copied to clipboard
abstract val proxy: Proxy?

Instructs the SDK to use a proxy configuration when communicating with PubNub servers.

Link copied to clipboard
abstract val proxyAuthenticator: Authenticator?
Link copied to clipboard
Link copied to clipboard
abstract val publishKey: String

The publish key from the admin panel (only required if publishing).

Link copied to clipboard

Retry configuration for requests. Defaults to RetryConfiguration.Exponential enabled only for subscription endpoint (other endpoints are excluded).

Link copied to clipboard
abstract val secretKey: String

The secret key from the admin panel (only required for modifying/revealing access permissions).

Link copied to clipboard
abstract val secure: Boolean

If set to true, requests will be made over HTTPS.

Link copied to clipboard
Link copied to clipboard
abstract val subscribeKey: String

The subscribe key from the admin panel.

Link copied to clipboard
abstract val subscribeTimeout: Int

The subscribe request timeout.

Link copied to clipboard

When true the SDK doesn't send out the leave requests.

Link copied to clipboard
abstract val userId: UserId

The user ID that the PubNub client will use.

Functions

Link copied to clipboard
abstract override fun authKey(authKey: String): PNConfiguration.Builder

If Access Manager (deprecated PAM v2) is utilized, client will use this authKey in all restricted requests.

Link copied to clipboard
abstract override fun build(): PNConfiguration

Create a PNConfiguration object with values from this builder.

Link copied to clipboard
abstract fun cacheBusting(cacheBusting: Boolean): PNConfiguration.Builder

If operating behind a misbehaving proxy, allow the client to shuffle the subdomains.

Link copied to clipboard
abstract fun certificatePinner(certificatePinner: CertificatePinner?): PNConfiguration.Builder
Link copied to clipboard
abstract fun connectionPoolKeepAliveDuration(connectionPoolKeepAliveDuration: Int): PNConfiguration.Builder

How long to keep idle connections alive in the OkHttp connection pool before evicting them.

Link copied to clipboard
abstract fun connectionPoolMaxIdleConnections(connectionPoolMaxIdleConnections: Int): PNConfiguration.Builder

Maximum number of idle connections to keep in the OkHttp connection pool.

Link copied to clipboard
abstract fun connectionSpec(connectionSpec: ConnectionSpec?): PNConfiguration.Builder
Link copied to clipboard
abstract override fun connectTimeout(connectTimeout: Int): PNConfiguration.Builder

How long before the client gives up trying to connect with the server.

Link copied to clipboard
abstract override fun cryptoModule(cryptoModule: CryptoModule?): PNConfiguration.Builder

CryptoModule is responsible for handling encryption and decryption. If set, all communications to and from PubNub will be encrypted.

Link copied to clipboard
abstract fun customLoggers(customLoggers: List<CustomLogger>?): PNConfiguration.Builder

Custom loggers list for creating additional logger instances. Use it if your slf4j implementation like logback, log4j2, etc. can't meet your specific logging requirements.

Link copied to clipboard
abstract fun dedupOnSubscribe(dedupOnSubscribe: Boolean): PNConfiguration.Builder
Link copied to clipboard
abstract fun fileMessagePublishRetryLimit(fileMessagePublishRetryLimit: Int): PNConfiguration.Builder

How many times publishing file message should automatically retry before marking the action as failed

Link copied to clipboard
abstract fun filterExpression(filterExpression: String): PNConfiguration.Builder

Feature to subscribe with a custom filter expression.

Link copied to clipboard
abstract fun googleAppEngineNetworking(googleAppEngineNetworking: Boolean): PNConfiguration.Builder

Enable Google App Engine networking.

Link copied to clipboard
abstract fun heartbeatInterval(heartbeatInterval: Int): PNConfiguration.Builder

How often the client will announce itself to server.

Link copied to clipboard

Set Heartbeat notification options.

Link copied to clipboard
Link copied to clipboard
abstract fun httpLoggingInterceptor(httpLoggingInterceptor: HttpLoggingInterceptor?): PNConfiguration.Builder

Sets a custom HttpLoggingInterceptor for logging network traffic.

Link copied to clipboard
abstract override fun includeInstanceIdentifier(includeInstanceIdentifier: Boolean): PNConfiguration.Builder

Whether to include a PubNubCore.instanceId with every request.

Link copied to clipboard
abstract override fun includeRequestIdentifier(includeRequestIdentifier: Boolean): PNConfiguration.Builder

Whether to include a PubNubCore.requestId with every request.

Link copied to clipboard

Set to PNLogVerbosity.BODY to enable logging of network traffic, otherwise se to PNLogVerbosity.NONE.

Link copied to clipboard
abstract fun maintainPresenceState(maintainPresenceState: Boolean): PNConfiguration.Builder

When true the SDK will resend the last channel state that was set using PubNub.setPresenceState for the current userId with every automatic heartbeat (if heartbeatInterval is greater than 0) and initial subscribe connection (also after e.g. loss of network).

Link copied to clipboard
abstract fun managePresenceListManually(managePresenceListManually: Boolean): PNConfiguration.Builder

Enables explicit presence control. When set to true heartbeat calls will contain only channels and groups added explicitly using PubNubCore.presence. Should be used only with ACL set on the server side. For more information please contact PubNub support

Link copied to clipboard
abstract fun maximumConnections(maximumConnections: Int?): PNConfiguration.Builder
Link copied to clipboard
abstract fun maximumMessagesCacheSize(maximumMessagesCacheSize: Int): PNConfiguration.Builder
Link copied to clipboard
abstract override fun nonSubscribeReadTimeout(nonSubscribeReadTimeout: Int): PNConfiguration.Builder

For non subscribe operations (publish, herenow, etc), This property relates to a read timeout that is applied from the moment the connection between a client and the server has been successfully established. It defines a maximum time of inactivity between two data packets when waiting for the server’s response.

Link copied to clipboard
open fun nonSubscribeRequestTimeout(nonSubscribeRequestTimeout: Int): PNConfiguration.Builder

For non subscribe operations (publish, herenow, etc), This property relates to a read timeout that is applied from the moment the connection between a client and the server has been successfully established. It defines a maximum time of inactivity between two data packets when waiting for the server’s response.

Link copied to clipboard
abstract fun origin(origin: String): PNConfiguration.Builder

Custom origin if needed.

Link copied to clipboard
abstract fun pnsdkSuffixes(pnsdkSuffixes: Map<String, String>): PNConfiguration.Builder
Link copied to clipboard
abstract fun presenceTimeout(presenceTimeout: Int): PNConfiguration.Builder

Sets the custom presence server timeout.

Link copied to clipboard
abstract fun proxy(proxy: Proxy?): PNConfiguration.Builder

Instructs the SDK to use a proxy configuration when communicating with PubNub servers.

Link copied to clipboard
abstract fun proxyAuthenticator(proxyAuthenticator: Authenticator?): PNConfiguration.Builder
Link copied to clipboard
abstract fun proxySelector(proxySelector: ProxySelector?): PNConfiguration.Builder
Link copied to clipboard
abstract override fun publishKey(publishKey: String): PNConfiguration.Builder

The publish key from the admin panel (only required if publishing).

Link copied to clipboard
abstract override fun retryConfiguration(retryConfiguration: RetryConfiguration): PNConfiguration.Builder

Retry configuration for requests. Defaults to RetryConfiguration.Exponential enabled only for subscription endpoint (other endpoints are excluded).

Link copied to clipboard
abstract override fun secretKey(secretKey: String): PNConfiguration.Builder

The secret key from the admin panel (only required for modifying/revealing access permissions).

Link copied to clipboard
abstract fun secure(secure: Boolean): PNConfiguration.Builder

If set to true, requests will be made over HTTPS.

Link copied to clipboard
abstract override fun setUserId(userId: UserId): PNConfiguration.Builder
Link copied to clipboard
Link copied to clipboard
abstract override fun subscribeKey(subscribeKey: String): PNConfiguration.Builder
Link copied to clipboard
abstract fun subscribeTimeout(subscribeTimeout: Int): PNConfiguration.Builder

The subscribe request timeout.

Link copied to clipboard
abstract fun suppressLeaveEvents(suppressLeaveEvents: Boolean): PNConfiguration.Builder

When true the SDK doesn't send out the leave requests.

Link copied to clipboard