Publish/Subscribe API for Unreal SDK

icon

Usage in Blueprints and C++


PubNub's publish-processing latency, the time to accept and acknowledge a publish request, is about 0.5 ms within the same region. Send a message to one recipient or broadcast to thousands of subscribers.

For higher-level conceptual details on publishing and subscribing, refer to Connection Management and to Publish Messages.

Asynchronous and synchronous method execution

Most PubNub Unreal SDK methods are available in both asynchronous and synchronous variants.

  • Asynchronous methods (Async suffix) return void and take an optional delegate parameter that fires when the operation completes.

    1PubnubClient->PublishMessageAsync("my-channel", "Hello!", OnPublishMessageResponseDelegate);

    You can also use native callbacks that accept lambdas instead of dynamic delegates. Native callback types have the Native suffix (for example, FOnPubnubPublishMessageResponseNative).

  • Synchronous methods (no suffix) block the main game thread until the operation completes and return a result struct directly.

    1FPubnubPublishMessageResult Result = PubnubClient->PublishMessage("my-channel", "Hello!");

Publish​

PublishMessage() sends a message to all channel subscribers. PubNub replicates the message across its points of presence and delivers it to all subscribed clients on that channel.

  • You must initialize PubNub with the publishKey.
  • You don't have to be subscribed to a channel to publish to it.
  • You cannot publish to multiple channels simultaneously.

You can call PublishMessage() on a Channel entity (which already knows its channel) or directly on the PubNub client by passing the channel name explicitly.

Channel entity​

icon

Available in entities

Channel

Method(s)​

To publish to a channel, you must first create a Channel entity where you provide the name of the channel you want to publish to.

1UPubnubChannelEntity* ChannelEntity = PubnubClient->CreateChannelEntity("my-channel");
2
3ChannelEntity->PublishMessage(
4 FString Message,
5 FOnPubnubPublishMessageResponse OnPublishMessageResponse,
6 FPubnubPublishSettings PublishSettings = FPubnubPublishSettings()
7);
required
Message required#
Type: FString
The message to publish. Can be a literal string or JSON-formatted string containing serialized data.
OnPublishMessageResponse#
The delegate for the operation's result.

You can also use a native callback of the type FOnPubnubPublishMessageResponseNative to handle the result using a lambda.
PublishSettings#
Struct defining publish configuration.
FPubnubPublishSettings​
StoreInHistory#
Type: bool
Whether to store the message so it is available to be returned by the History API. true by default.
Ttl#
Type: int
Time-to-live (TTL) for the message in hours. If not specified, the message will use the default retention period configured for the key.
MetaData#
Type: FString
A JSON object containing additional (meta) data about the message which you can use with the filtering ability.
PublishMethod#
Type: EPubnubPublishMethod
Which HTTP method to use for the publish transaction. Default is PPM_SendViaGET. Available values:

  • PPM_SendViaGET: puts the message in the URL path. You can't compress it.
  • PPM_SendViaPOST: puts the message in the request body. Required for compression.
Compress#
Type: EPubnubPublishCompress
Whether to gzip the request body. Default is PPC_No. Available values:

  • PPC_No: sends the body uncompressed.
  • PPC_Yes: sends the body gzip-compressed. Applies only when PublishMethod is PPM_SendViaPOST. It doesn't switch a GET publish to POST.
CustomMessageType#
Type: FString
A case-sensitive, alphanumeric string from 3 to 50 characters describing the business-specific label or category of the message. Dashes - and underscores _ are allowed. The value cannot start with special characters or the string pn_ or pn-.

Examples: text, action, poll.

Sample code​

Publish a message to a channel​
Actor.h​

1

Actor.cpp​

1

Subscribe to the channel

Before running the above publish example (either using the Debug Console or in a separate script running in a new terminal window), subscribe to the same channel that you publish the message to.

Returns​

This function is void, but the delegate returns the FOnPubnubPublishMessageResponse struct.

FOnPubnubPublishMessageResponse​
FieldTypeDescription
ResultFPubnubOperationResultThe result of the operation.
PublishedMessageFPubnubMessageDataA struct containing the result of the operation.
FPubnubMessageData​
FieldTypeDescription
MessageFStringThe message itself.
ChannelFStringChannel that the message was published to.
UserIDFStringThe message information about the publisher.
TimetokenFStringThe time token of the message, indicating when it was published.
MetadataFStringThe message metadata, as published.
MessageTypeEPubnubMessageTypeIndicates the message type: a signal, published, or another type.
CustomMessageTypeFStringUser-provided message type.
MatchOrGroupFStringSubscription match or the channel group.
regionintRegion of the message. Always 0.
flagsintMessage flags.
EPubnubMessageType​
FieldDescription
PMT_SignalIndicates that the message was received as a signal.
PMT_PublishedIndicates that the message was published.
PMT_ActionIndicates an action on a published message.
PMT_ObjectsMessage about Objects.
PMT_FilesMessage about Files.
FOnPubnubPublishMessageResponseNative​
FieldTypeDescription
Resultconst FPubnubOperationResult&The result of the operation.
PublishedMessageconst FPubnubMessageData&A struct containing the result of the operation.

Other examples​

Publish a message with settings​
Actor.h​

1

Actor.cpp​

1

Publish a message with result​
Actor.h​

1

Actor.cpp​

1

PubNub client​

Method(s)​

1PubnubClient->PublishMessageAsync(
2 FString Channel,
3 FString Message,
4 FOnPubnubPublishMessageResponse OnPublishMessageResponse,
5 FPubnubPublishSettings PublishSettings = FPubnubPublishSettings()
6);
required
Channel required#
Type: FString
The channel ID to send the message to.
Message required#
Type: FString
The message to publish. Can be a literal string or JSON-formatted string containing serialized data.
OnPublishMessageResponse#
The delegate for the operation's result.

You can also use a native callback of the type FOnPubnubPublishMessageResponseNative to handle the result using a lambda.
PublishSettings#
Struct defining publish configuration.

Sample code​

Publish a message to a channel​
Actor.h​

1

Actor.cpp​

1

Returns​

This method is void. The delegate returns the following struct:

FOnPubnubPublishMessageResponse​
FieldTypeDescription
ResultFPubnubOperationResultThe result of the operation.
PublishedMessageFPubnubMessageDataA struct containing the published message data including timetoken and channel information.
FOnPubnubPublishMessageResponseNative​
FieldTypeDescription
Resultconst FPubnubOperationResult&The result of the operation.
PublishedMessageconst FPubnubMessageData&A struct containing the published message data including timetoken and channel information.

Other examples​

Publish a message with settings​
Actor.h​

1

Actor.cpp​

1

Publish a compressed message​

Set PublishMethod to PPM_SendViaPOST and Compress to PPC_Yes to send the message body gzip-compressed.

Actor.h​

1

Actor.cpp​

1

Publish a message with result​
Actor.h​

1

Actor.cpp​

1

Signal​

The Signal() function sends a signal to all subscribers of a channel.

By default, signals are limited to a message payload size of 64 bytes. This limit applies only to the payload, and not to the URI or headers. If you require a larger payload size, contact support.

  • You must initialize PubNub with the publishKey.
  • The message payload size (without the URI or headers) is limited to 64 bytes. If you require a larger payload size, contact support.

You can call Signal() on a Channel entity (which already knows its channel) or directly on the PubNub client by passing the channel name explicitly.

Channel entity​

icon

Available in entities

Channel

Method(s)​

To signal to a channel, you must first create a Channel entity where you provide the name of the channel you want to signal to.

1UPubnubChannelEntity* ChannelEntity = PubnubClient->CreateChannelEntity("my-channel");
2
3ChannelEntity->Signal(
4 FString Message,
5 FOnPubnubSignalResponse OnSignalResponse,
6 FPubnubSignalSettings SignalSettings = FPubnubSignalSettings()
7);
required
Message required#
Type: FString
The message to publish. Can be a literal string or JSON-formatted string containing serialized data.
OnSignalResponse#
The delegate for the operation's result.

You can also use a native callback of the type FOnPubnubSignalResponseNative to handle the result using a lambda.
SignalSettings#
Struct defining signal configuration.
FPubnubSignalSettings​
CustomMessageType#
Type: FString
A case-sensitive, alphanumeric string from 3 to 50 characters describing the business-specific label or category of the message. Dashes - and underscores _ are allowed. The value cannot start with special characters or the string pn_ or pn-.

Examples: text, action, poll.

Sample code​

Signal a message to a channel​
Actor.h​

1

Actor.cpp​

1

Returns​

The delegate returns the FOnPubnubSignalResponse struct.

FOnPubnubSignalResponse​
FieldTypeDescription
ResultFPubnubOperationResultThe result of the operation.
SignalMessageFPubnubMessageDataA struct containing the result of the operation.
FOnPubnubSignalResponseNative​
FieldTypeDescription
Resultconst FPubnubOperationResult&The result of the operation.
SignalMessageconst FPubnubMessageData&A struct containing the result of the operation.

Other examples​

Signal with custom message type​
Actor.h​

1

Actor.cpp​

1

PubNub client​

Method(s)​

1PubnubClient->SignalAsync(
2 FString Channel,
3 FString Message,
4 FOnPubnubSignalResponse OnSignalResponse,
5 FPubnubSignalSettings SignalSettings = FPubnubSignalSettings()
6);
required
Channel required#
Type: FString
The channel ID to send the signal to.
Message required#
Type: FString
The message to publish. Can be a literal string or JSON-formatted string containing serialized data.
OnSignalResponse#
The delegate for the operation's result.

You can also use a native callback of the type FOnPubnubSignalResponseNative to handle the result using a lambda.
SignalSettings#
Struct defining signal configuration.

Sample code​

Signal a message to a channel​
Actor.h​

1

Actor.cpp​

1

Returns​

This method is void. The delegate returns the following struct:

FOnPubnubSignalResponse​
FieldTypeDescription
ResultFPubnubOperationResultThe result of the operation.
SignalMessageFPubnubMessageDataA struct containing the signal message data including timetoken and channel information.
FOnPubnubSignalResponseNative​
FieldTypeDescription
Resultconst FPubnubOperationResult&The result of the operation.
SignalMessageconst FPubnubMessageData&A struct containing the signal message data including timetoken and channel information.

Other examples​

Signal with custom message type​
Actor.h​

1

Actor.cpp​

1

Signal with result​
Actor.h​

1

Actor.cpp​

1

Subscribe​

Subscribe opens a TCP socket and listens for messages and events on a specified entity or set of entities. Set SubscribeKey during initialization.

Conceptual overview

For more general information about subscriptions, refer to Subscriptions.

Entities are first-class citizens that expose their APIs. You can subscribe using the PubNub client or directly on a specific entity:

After Subscribe(), the client receives new messages. Monitor the connection through the OnSubscriptionStatusChanged listener on the PubNub client.

Subscription scope​

Subscriptions let you attach listeners for specific real-time update types. Your app receives messages and events through those listeners. There are two types:

  • Subscription: created from an entity and scoped to that entity (for example, a particular channel)
  • SubscriptionSet: created from the PubNub client and scoped to the client (for example, all subscriptions created on a single UPubnubClient object). A set can include one or more subscriptions.

The event listener is a single point through which your app receives all the messages, signals, and events in the entities you subscribed to. For information on adding event listeners, refer to Event listeners.

Create a subscription​

Managing subscription lifecycle

The subscription object lives independently from the entity and requires separate lifecycle management. The subscription will remain valid and functional even if the entity goes out of scope or is destroyed.

An entity-level Subscription allows you to receive messages and events for only that entity for which it was created. Using multiple entity-level Subscriptions is useful for handling various message/event types differently in each channel.

1// Create entity
2UPubnubChannelEntity* ChannelEntity = PubnubClient->CreateChannelEntity("my-channel");
3
4// Create subscription from entity
5UPubnubSubscription* Subscription = ChannelEntity->CreateSubscription();
SubscribeSettings#
Settings for the subscription configuration.

FPubnubSubscribeSettings​

ReceivePresenceEvents#
Type: bool
Whether to subscribe to presence events.

Create a subscription set​

Managing subscription lifecycle

The subscription object lives independently from the entity and requires separate lifecycle management. The subscription will remain valid and functional even if the entity goes out of scope or is destroyed.

A client-level SubscriptionSet allows you to receive messages and events for all entities in the set. A single SubscriptionSet is useful for similarly handling various message/event types in each channel.

From channel or channel group names​

You can create a subscription set from channel and channel group names.

1PubnubClient->CreateSubscriptionSet(Channels, ChannelGroups, SubscriptionSettings);
Channels#
Type: TArray<FString>
Array of channel names to include in the subscription set.
ChannelGroups#
Type: TArray<FString>
Array of channel group names to include in the subscription set.
SubscriptionSettings#
Settings for the subscription configuration.

From entities​

You can create a subscription set from existing entities.

1PubnubClient->CreateSubscriptionSetFromEntities(Entities, SubscriptionSettings);
required
Entities required#
Type: TArray<UPubnubBaseEntity*>
Array of entities to include in the subscription set.
SubscriptionSettings#
Settings for the subscription configuration.

Method(s)​

Subscription and SubscriptionSet use the same methods to subscribe:

Subscribe​

To subscribe, you can use the following methods:

1// Subscribe to start receiving messages
2Subscription->Subscribe();
3// Subscribe to all entities in the set
4SubscriptionSet->Subscribe();

Both methods return an FPubnubOperationResult. A success result means the SDK registered the subscription. It doesn't mean the client connected. The connection outcome arrives on the OnSubscriptionStatusChanged listener of the PubNub client.

Sample code​

Subscribe to a channel​
Actor.h​

1

Actor.cpp​

1

Subscribe with timetoken​

You can subscribe with a specific timetoken to receive messages from that point in time.

1// Subscribe with timetoken
2FPubnubSubscriptionCursor Cursor;
3Cursor.Timetoken = "15640261328790011";
4
5Subscription->Subscribe(Cursor);
FPubnubSubscriptionCursor​
required
Timetoken required#
Type: FString
Timetoken from which messages should be retrieved.
Region#
Type: int
Ignored. The SDK doesn't use this value, so leave it at 0.

Add subscriptions​

You can add individual subscriptions to an existing set to create new sets. If you subscribe to a subscription set and then add more subscriptions, they are automatically subscribed to.

1// Add individual subscription to set
2UPubnubSubscription* NewSubscription = ChannelEntity->CreateSubscription();
3SubscriptionSet->AddSubscription(NewSubscription);

Remove subscriptions​

You can remove individual subscriptions from a subscription set.

1// Remove subscription from set
2SubscriptionSet->RemoveSubscription(NewSubscription);

Merge subscription sets​

You can merge multiple subscription sets together.

1// Merge subscription sets
2SubscriptionSet1->AddSubscriptionSet(SubscriptionSet2);

Remove subscription sets​

You can remove entire subscription sets from another set.

1// Remove subscription set from another set
2SubscriptionSet1->RemoveSubscriptionSet(SubscriptionSet2);

Other examples​

Subscribe to a channel group​

Actor.h​
1

Actor.cpp​
1

Subscribe to channel metadata​

Actor.h​
1

Actor.cpp​
1

Subscribe to user metadata​

Actor.h​
1

Actor.cpp​
1

Create subscription set from names​

Actor.h​
1

Actor.cpp​
1

Create subscription set from entities​

Actor.h​
1

Actor.cpp​
1

Manage subscriptions in a set​

Actor.h​
1

Actor.cpp​
1

Merge subscription sets​

Actor.h​
1

Actor.cpp​
1

Event listeners​

Messages and events are received in your app using listeners. This listener allows a single point to receive all messages, signals, and events.

You can attach listeners to the instances of Subscription, SubscriptionSet.

No built-in event throttling

The PubNub SDK delivers every incoming event to your listener as it arrives. There is no built-in throttling or rate-limiting on the subscriber side. If you need to control how often your application processes events, wrap your listener callback with a throttle or debounce utility from your language or framework ecosystem.

To reduce the number of messages delivered to your client in the first place, use Subscribe Filters to filter messages server-side before they reach your listener.

Add listeners​

You can add listeners for various types of updates related to your subscription. You can implement listeners for general updates (that handle multiple event types at once) or choose listeners dedicated to specific event types such as Message or Signal.

Catch all events

The OnAnyEventReceived listener catches all event types.

Handle multiple event types​

You can add multiple event listeners to handle different types of events.

1// Add message listener
2Subscription->OnPubnubMessage.AddDynamic(this, &AMyActor::OnMessageReceived);
3
4// Add signal listener
5Subscription->OnPubnubSignal.AddDynamic(this, &AMyActor::OnSignalReceived);
6
7// Add presence event listener
8Subscription->OnPubnubPresenceEvent.AddDynamic(this, &AMyActor::OnPresenceEventReceived);
9
10// Add object event listener
11Subscription->OnPubnubObjectEvent.AddDynamic(this, &AMyActor::OnObjectEventReceived);
12
13// Add message action listener
14Subscription->OnPubnubMessageAction.AddDynamic(this, &AMyActor::OnMessageActionReceived);
15
show all 17 lines

Handle one event type with native callbacks​

You can also use native callbacks that support lambda expressions.

1// Add native callback listeners
2Subscription->OnPubnubMessageNative.AddLambda([](const FPubnubMessageData& Message) {
3 UE_LOG(LogTemp, Log, TEXT("Message received: %s"), *Message.Message);
4});
5
6Subscription->OnPubnubSignalNative.AddLambda([](const FPubnubMessageData& Signal) {
7 UE_LOG(LogTemp, Log, TEXT("Signal received: %s"), *Signal.Message);
8});

Remove event listener​

To remove the listener for a specific event, assign nullptr to it or use RemoveAll() on the delegate.

1// Remove specific listener
2Subscription->OnPubnubMessage.RemoveDynamic(this, &AMyActor::OnMessageReceived);
3
4// Remove all listeners for a specific event type
5Subscription->OnPubnubMessage.RemoveAll(this);

Add connection status listener​

Use the subscription status listener with your PubnubClient instance to add a listener dedicated to connection status updates.

Client scope

This listener is only available on the UPubnubClient object.

Method(s)​

1// Add subscription status listener
2PubnubClient->OnSubscriptionStatusChanged.AddDynamic(this, &AMyActor::OnSubscriptionStatusChanged);

Sample code​

Actor.h​


1


Actor.cpp​


1

Other examples​

Subscribe with all event listeners​

Actor.h​
1

Actor.cpp​
1

Add message listener with lambda​

Actor.h​
1

Actor.cpp​
1

Returns​

The listener receives an EPubnubSubscriptionStatus value and an FPubnubSubscriptionStatusData struct. Depending on your client network connection, it emits PSS_Connected, PSS_ConnectionError, PSS_DisconnectedUnexpectedly, PSS_Disconnected, or PSS_SubscriptionChanged. Because SubscribeToChannel(), SubscribeToGroup(), and Subscribe() succeed once the subscription is registered, use this listener to find out whether the connection succeeded.

For more information on connection management, refer to SDK Connection Lifecycle.

Other examples​

Add connection status listener with lambda​
Actor.h​
1

Actor.cpp​
1

Unsubscribe​

Stop receiving real-time updates from a Subscription or a SubscriptionSet.

Method(s)​

1// Unsubscribe from a subscription
2Subscription->Unsubscribe();
3
4// Unsubscribe from a subscription set
5SubscriptionSet->Unsubscribe();

Sample code​

Unsubscribe from a subscription​

1// Unsubscribe from a subscription
2Subscription->Unsubscribe();

Unsubscribe from a subscription set​

1// Unsubscribe from all entities in the set
2SubscriptionSet->Unsubscribe();

Returns​

None

Unsubscribe all​

Stop receiving real-time updates from all listeners and remove the entities associated with them.

Client scope

This method is only available on the UPubnubClient object.

Method(s)​

1PubnubClient->UnsubscribeFromAllAsync(FOnPubnubSubscribeOperationResponse OnUnsubscribeFromAllResponse);
OnUnsubscribeFromAllResponse#
The delegate for the operation's result.

You can also use a native callback of the type FOnPubnubSubscribeOperationResponseNative to handle the result using a lambda.

Sample code​

Actor.h​


1

Actor.cpp​


1

Returns​

This method is void. The delegate returns the following struct:

FOnPubnubSubscribeOperationResponse​

FieldTypeDescription
ResultFPubnubOperationResultThe result of the operation.

FOnPubnubSubscribeOperationResponseNative​

FieldTypeDescription
Resultconst FPubnubOperationResult&The result of the operation.

Subscribe with the PubNub client​

You can also subscribe to a single channel or channel group directly on the UPubnubClient object, without creating a Subscription.

Subscribe result and connection status

SubscribeToChannel() and SubscribeToGroup() succeed as soon as the SDK registers the subscription. The result doesn't tell you whether the client connected to PubNub. The connection outcome arrives later on the OnSubscriptionStatusChanged listener.

Receive messages​

Your app receives messages and events via event listeners. The OnMessageReceived event listener is a single point through which your app receives all the messages, signals, and events that are sent in any channel you are subscribed to.

For more information about adding a listener, refer to the Event Listeners section.

Description​

This function causes the client to create an open TCP socket to the PubNub Real-Time Network and begin listening for messages on a specified channel ID. To subscribe to a channel ID, the client must send the appropriate SubscribeKey at initialization.

By default, a newly subscribed client will only receive messages published to the channel after the Subscribe() call completes.

Unsubscribing from all channels

Unsubscribing from all channels, and then subscribing to a new channel Y is not the same as subscribing to channel Y and then unsubscribing from the previously-subscribed channel(s). Unsubscribing from all channels resets the last-received timetoken and thus, there could be some gaps in the subscription that may lead to message loss.

Method(s)​

1// subscribe to a channel
2PubnubClient->SubscribeToChannelAsync(FString Channel, FOnPubnubSubscribeOperationResponse OnSubscribeToChannelResponse, FPubnubSubscribeSettings SubscribeSettings = FPubnubSubscribeSettings());
3// subscribe to a channel group
4PubnubClient->SubscribeToGroupAsync(FString ChannelGroup, FOnPubnubSubscribeOperationResponse OnSubscribeToGroupResponse, FPubnubSubscribeSettings SubscribeSettings = FPubnubSubscribeSettings());
required
Channel required#
Type: FString
The channel ID to subscribe to.
ChannelGroup required#
Type: FString
The channel group to subscribe to.
OnSubscribeToChannelResponse#
The delegate for the operation's result. It reports that the subscription was registered, not that the client connected.

You can also use a native callback of the type FOnPubnubSubscribeOperationResponseNative to handle the result using a lambda.
OnSubscribeToGroupResponse#
The delegate for the operation's result. It reports that the subscription was registered, not that the client connected.

You can also use a native callback of the type FOnPubnubSubscribeOperationResponseNative to handle the result using a lambda.
SubscribeSettings#
Struct defining subscription configuration.

The synchronous SubscribeToChannel() and SubscribeToGroup() methods take the same parameters except the delegates and return an FPubnubOperationResult. The result reports local acceptance only.

Sample code​

Actor.h​

1

Actor.cpp​

1

Event listeners

The response of the call is handled by adding a listener. Refer to the Event Listeners section for more details. Listeners should be added before calling the method.

Returns​

The asynchronous methods are void and report the result through the delegate. To receive messages, you must add a listener.

Other examples​

Subscribe with presence​
Requires Presence

This method requires that the Presence add-on is enabled for your key in the Admin Portal.

For information on how to receive presence events and what those events are, refer to Presence Events.

For any given channel there is an associated Presence channel. You can subscribe directly to the channel by appending -pnpres to the channel name or you can use the subscribe method with the ReceivePresenceEvents parameter set to true. For more information on presence events, refer to the Presence section.

Actor.h​

1

Actor.cpp​

1

Response

All presence events are received via a listener. For more information on the structure of the received events, refer to Event types.

Subscribe to channel group​
Actor.h​

1

Actor.cpp​

1

Subscribe with lambda​
Actor.h​

1

Actor.cpp​

1

Subscribe with result callback​
Actor.h​

1

Actor.cpp​

1

Unsubscribe with the PubNub client​

Use these methods to unsubscribe from a channel or channel group that you subscribed to with the PubNub client.

When subscribed to a single channel, this function causes the client to issue a leave from the channel ID and close any open socket to the PubNub Network. For multiplexed channels, the specified channel(s) will be removed and the socket remains open until there are no more channels remaining in the list.

Unsubscribing from all channels

Unsubscribing from all channels, and then subscribing to a new channel Y is not the same as subscribing to channel Y and then unsubscribing from the previously-subscribed channel(s). Unsubscribing from all channels resets the last-received timetoken and thus, there could be some gaps in the subscription that may lead to message loss.

Method(s)​

1// unsubscribe from a channel
2PubnubClient->UnsubscribeFromChannelAsync(FString Channel, FOnPubnubSubscribeOperationResponse OnUnsubscribeFromChannelResponse);
3// unsubscribe from a channel group
4PubnubClient->UnsubscribeFromGroupAsync(FString ChannelGroup, FOnPubnubSubscribeOperationResponse OnUnsubscribeFromGroupResponse);
required
Channel required#
Type: FString
The channel ID to unsubscribe from.
ChannelGroup required#
Type: FString
The channel group to unsubscribe from.
OnUnsubscribeFromChannelResponse#
The delegate for the operation's result.

You can also use a native callback of the type FOnPubnubSubscribeOperationResponseNative to handle the result using a lambda.
OnUnsubscribeFromGroupResponse#
The delegate for the operation's result.

You can also use a native callback of the type FOnPubnubSubscribeOperationResponseNative to handle the result using a lambda.

Sample code​

Actor.h​

1

Actor.cpp​

1

Returns​

This method doesn't have a return value.

Other examples​

Unsubscribe from a channel group​
Actor.h​

1

Actor.cpp​

1

Complete example​

ASample_PubSubFull.h​


1

ASample_PubSubFull.cpp​


1

Was this page useful?

Last updated on