---
source_url: https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/updates
title: Manage message updates
updated_at: 2026-05-28T15:00:45.130Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Manage message updates

:::note Requires Message Persistence
Enable [Message Persistence](https://youtu.be/qLMtbINWGig) in the [Admin Portal](https://admin.pubnub.com/).
:::

Edit messages and receive real-time update events.

##### Usage in Blueprints and C++

You can use PubNub's functionality via Blueprints or directly in C++ code.

* In Blueprints, you can access PubNub from any Widget or Actor. Start by [initializing chat](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/configuration#initialize-pubnub-chat) using `InitChat` on `UPubnubChatSubsystem`. Afterwards, you can use the returned `UPubnubChat` object reference to call all Chat SDK functions.

:::warning Blueprint functions
The Blueprints provided in the documentation show how you can structure your application and may contain utility methods and elements like buttons that are not part of the Unreal Chat SDK and are meant to serve as guidance.
:::

* In C++, you can use UPubnubChatSubsystem as any other Game Instance Subsystem. #include "Kismet/GameplayStatics.h" #include "Engine/GameInstance.h" #include "PubnubChatSubsystem.h" // ACTION REQUIRED: Replace ASample_ChatSubsystem with name of your Actor class void ASample_ChatSubsystem::InitChatSample() { // Get PubnubChatSubsystem from GameInstance UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this); UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>(); // Initialize Chat - InitChat may fail under some conditions so make sure to check the Result for errors before using the Chat FPubnubChatInitChatResult InitChatResult = PubnubChatSubsystem->InitChat(TEXT("demo"), TEXT("demo"), TEXT("Player_001")); UPubnubChat* PubnubChat = InitChatResult.Chat; } Chat now allows you to call all Chat SDK functions, for example, Chat->GetChannel("my_channel").

:::note 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. 1Message->EditTextAsync(NewText, OnEditTextResponseDelegate); You can also use native callbacks that accept lambdas instead of dynamic delegates. Native callback types have the Native suffix (for example, FOnPubnubChatOperationResponseNative).
* Synchronous methods (no suffix) block the main game thread until the operation completes and return a result struct directly. 1FPubnubChatOperationResult Result = Message->EditText(NewText);
:::

## Edit messages

`EditText()` replaces an existing message's content.

### Method signature

#### Blueprint

#### C++ / Input parameters

```cpp
Message->EditText(FString NewText);
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| NewText | FString | Yes |  | New/updated text that you want to add in place of the existing message. |

#### Output

| Type | Description |
| --- | --- |
| `FPubnubChatOperationResult` | Result of the operation. Check `Error` and `ErrorMessage` for failure. |

### Sample code

:::tip Reference code
This example is a self-contained code snippet ready to be run. Set up your Unreal project and follow the instructions in the lines marked with `ACTION REQUIRED` before running the code. Use it as a reference when working with other examples in this document.
:::

Edit message text asynchronously.

###### C++

###### Actor.h

```cpp
// blueprint.0kdeymv2
UFUNCTION(BlueprintCallable, Category = "PubnubChat|Samples|ChatMessage")
void EditTextSample();
```

###### Actor.cpp

```cpp
// ACTION REQUIRED: Replace ASample_ChatMessage with name of your Actor class
void ASample_ChatMessage::EditTextSample()
{
	// snippet.hide
	UPubnubChatMessage* Message = nullptr;
	// snippet.show

	// Assumes Message is a valid UPubnubChatMessage

	// New text content for the message
	FString NewText = TEXT("Updated message text");

	// Edit the message (no result callback needed)
	Message->EditTextAsync(NewText, nullptr);
}
```

###### Blueprint

## Get message updates

Receive real-time updates when messages or [reactions](https://www.pubnub.com/docs/chat/unreal-chat-sdk/build/features/messages/reactions) change:

* `StreamUpdates()` - updates for a single [Message object](https://www.pubnub.com/docs/chat/unreal-chat-sdk/learn/chat-entities/message)
* `StreamUpdatesOn()` - updates for multiple `Message` objects

Bind the message's `OnUpdated` delegate (Blueprint) or `OnUpdatedNative` delegate (C++) before calling `StreamUpdates()`. Call `StopStreamingUpdates()` to stop receiving updates.

:::note Stream update behavior
* `StreamUpdates()` fires the message's `OnUpdated` delegate with `(FString Timetoken, FPubnubChatMessageData MessageData)` on each change.
* `StreamUpdatesOn()` is a static method that calls `StreamUpdates()` on each message in the array. Each message fires its own `OnUpdated` delegate individually.
:::

### Method signature

#### Blueprint

#### C++ / Input parameters

* StreamUpdates() 1Message->StreamUpdates();
* StreamUpdatesOn() 1UPubnubChatMessage::StreamUpdatesOn(TArray<UPubnubChatMessage*> Messages);
* StopStreamingUpdates() 1Message->StopStreamingUpdates();

| Parameter | Required in `StreamUpdatesOn()` | Description |
| --- | --- | --- |
| `Messages`Type: `TArray<UPubnubChatMessage*>`Default: n/a | Yes | Array of [Message objects](https://www.pubnub.com/docs/chat/unreal-chat-sdk/learn/chat-entities/message) for which you want to get updates. |

#### Output

| Method | Return type | Description |
| --- | --- | --- |
| `StreamUpdates()` | `FPubnubChatOperationResult` | Result of the operation. Check `Error` for failure. |
| `StreamUpdatesOn()` | `FPubnubChatOperationResult` | Result of the operation. Check `Error` for failure. |
| `StopStreamingUpdates()` | `FPubnubChatOperationResult` | Result of the operation. Check `Error` for failure. |

### Sample code

* StreamUpdates() Get message and message reaction-related updates for a message published on the support channel.

#### C++

```cpp
// ACTION REQUIRED: Replace ASample_ChatMessage with name of your Actor class
void ASample_ChatMessage::StreamUpdatesSample()
{
	// snippet.hide
	UPubnubChatMessage* Message = nullptr;
	// snippet.show

	// Assumes Message is a valid UPubnubChatMessage

	// Bind to receive message action updates (edits, reactions, deletes)
	Message->OnUpdatedNative.AddUObject(this, &ASample_ChatMessage::OnMessageUpdateReceived);

	// Start streaming updates (no result callback needed)
	Message->StreamUpdatesAsync(nullptr);

	// When updates are no longer needed, stop streaming
	Message->StopStreamingUpdatesAsync(nullptr);
}

// ACTION REQUIRED: Replace ASample_ChatMessage with name of your Actor class
void ASample_ChatMessage::OnMessageUpdateReceived(FString Timetoken, const FPubnubChatMessageData& MessageData)
{
	/* e.g. update message UI when edits or reactions arrive */
}
```

#### Blueprint

### Other examples

Stop listening to updates for a message.

###### Actor.h

```cpp
// blueprint._e51uod5
UFUNCTION(BlueprintCallable, Category = "PubnubChat|Samples|ChatMessage")
void StreamUpdatesSample();

void OnMessageUpdateReceived(FString Timetoken, const FPubnubChatMessageData& MessageData);
```

###### Actor.cpp

```cpp
// ACTION REQUIRED: Replace ASample_ChatMessage with name of your Actor class
void ASample_ChatMessage::StreamUpdatesSample()
{
	// snippet.hide
	UPubnubChatMessage* Message = nullptr;
	// snippet.show

	// Assumes Message is a valid UPubnubChatMessage

	// Bind to receive message action updates (edits, reactions, deletes)
	Message->OnUpdatedNative.AddUObject(this, &ASample_ChatMessage::OnMessageUpdateReceived);

	// Start streaming updates (no result callback needed)
	Message->StreamUpdatesAsync(nullptr);

	// When updates are no longer needed, stop streaming
	Message->StopStreamingUpdatesAsync(nullptr);
}

// ACTION REQUIRED: Replace ASample_ChatMessage with name of your Actor class
void ASample_ChatMessage::OnMessageUpdateReceived(FString Timetoken, const FPubnubChatMessageData& MessageData)
{
	/* e.g. update message UI when edits or reactions arrive */
}
```