fire

expect abstract fun fire(channel: String, message: Any, meta: Any? = null, usePost: Boolean = false): Publish
actual abstract fun fire(channel: String, message: Any, meta: Any?, usePost: Boolean): Publish

Send a message to PubNub Functions Event Handlers.

These messages will go directly to any Event Handlers registered on the channel that you fire to and will trigger their execution. The content of the fired request will be available for processing within the Event Handler.

The message sent via fire() isn't replicated, and so won't be received by any subscribers to the channel. The message is also not stored in history.

Parameters

message

The payload. Warning: It is important to note that you should not serialize JSON when sending signals/messages via PubNub. Why? Because the serialization is done for you automatically. Instead just pass the full object as the message payload. PubNub takes care of everything for you.

channel

Destination of the message.

meta

Metadata object which can be used with the filtering ability. If not specified, then the history configuration of the key is used.

usePost

Use HTTP POST to publish. Default is false


abstract fun fire(channel: String, message: Any, meta: Any?, usePost: Boolean, ttl: Int?): Publish

Deprecated

`fire()` never used the `ttl` parameter, please use the version without `ttl`.

Replace with

fire(channel, message, meta, usePost)

Send a message to PubNub Functions Event Handlers.

These messages will go directly to any Event Handlers registered on the channel that you fire to and will trigger their execution. The content of the fired request will be available for processing within the Event Handler.

The message sent via fire() isn't replicated, and so won't be received by any subscribers to the channel. The message is also not stored in history.

Parameters

message

The payload. Warning: It is important to note that you should not serialize JSON when sending signals/messages via PubNub. Why? Because the serialization is done for you automatically. Instead just pass the full object as the message payload. PubNub takes care of everything for you.

channel

Destination of the message.

meta

Metadata object which can be used with the filtering ability. If not specified, then the history configuration of the key is used.

usePost

Use HTTP POST to publish. Default is false

actual abstract fun fire(channel: String, message: Any, meta: Any?, usePost: Boolean): Publish