Channel Entity

As of version 1.1.0, the Unreal Engine software development kit (SDK) supports entities. Entities are SDK objects that bundle operations for a specific resource type and simplify working with PubNub application programming interfaces (APIs).

Use entities to perform common tasks without manually wiring requests. Some PubNub APIs are exposed via entities. Other operations are available on UPubnubClient. See Configuration and the API reference for details.

Create a Channel​

Use this UPubnubClient factory method to return a local Channel entity for a single channel. A Channel entity centralizes common operations, such as subscribing and publishing, so you can prototype and build faster.

1UPubnubChannelEntity* CreateChannelEntity(FString Channel);
required
Channel required#
Type: FString
Name of the channel for which to create the entity.

Sample code​

1

Available operations​

The Channel entity provides operations for PubNub channels.

Operation (click for more information)Description
CreateSubscription(SubscribeSettings)Returns a local channel subscription object with optional parameters. You can then subscribe to receive real-time updates for that channel.
PublishMessage(Message, OnPublishMessageResponse, PublishSettings)Sends a message to all channel subscribers.
Signal(Message, OnSignalResponse, SignalSettings)Sends a signal to all subscribers of the channel.
ListUsersFromChannel(ListUsersFromChannelResponse, ListUsersFromChannelSettings)Lists users currently present on the channel. Requires the Presence add-on.

Publish a simple message​

Create a Channel entity and publish a simple text message to it using PublishMessageAsync.

1

Was this page useful?

Last updated on