TsgcWSPClient_PresenceMethods › Publish

Publish Method

Publishes a text message to every member of a channel.

Syntax

procedure Publish(const aText: String; const aChannel: String = '');

Parameters

NameTypeDescription
aTextconst StringPayload delivered to every subscriber of the channel.
aChannelconst StringChannel on which the message is published. Leave empty to address the default channel.

Remarks

Sends a Presence publish message tagged with the caller's session id and member info. Every client currently subscribed to the channel receives it through OnPublishMsg. If the server cannot deliver it (for example because the channel does not exist or the sender is not allowed to publish), OnErrorPublishMsg fires on this client instead.

Example

oPresence.Publish('hello everyone', 'chat');

Back to Methods