Channel

interface Channel : Subscribable

A representation of a PubNub channel identified by its name.

You can get a Subscription to this channel through Subscribable.subscription.

Use the com.pubnub.api.PubNub.channel factory method to create instances of this interface.

Properties

Link copied to clipboard
abstract val name: String

The name of this channel. Supports wildcards by ending it with ".*"

Functions

Link copied to clipboard
abstract fun deleteFile(fileName: String, fileId: String): DeleteFile

Delete file from the Channel.

Link copied to clipboard
abstract fun fire(message: Any, meta: Any? = null, usePost: Boolean = false, ttl: Int? = null): Publish

Send a message to PubNub Functions Event Handlers.

Link copied to clipboard
abstract fun publish(message: Any, meta: Any? = null, shouldStore: Boolean = true, usePost: Boolean = false, replicate: Boolean = true, ttl: Int? = null, customMessageType: String? = null): Publish

Send a message to all subscribers of the channel.

Link copied to clipboard
abstract fun sendFile(fileName: String, inputStream: Uploadable, message: Any? = null, meta: Any? = null, ttl: Int? = null, shouldStore: Boolean? = null, cipherKey: String? = null, customMessageType: String? = null): SendFile

Upload file / data to the Channel.

Link copied to clipboard
abstract fun signal(message: Any, customMessageType: String? = null): Signal

Send a signal to all subscribers of the channel.

Link copied to clipboard
abstract override fun subscription(options: SubscriptionOptions): Subscription

Returns a Subscription that can be used to subscribe to this channel.