On this page

Read receipts

Required setup

Read Receipts requires Unread Message Count. First, set the last read timetoken for each user on a channel.

Read receipts show if channel members have viewed a message.

icon

Usage in Blueprints and C++


Get read receipts

StreamReadReceipts() provides read status for messages on a channel. The method fetches member read status, listens for updates, and passes receipt events to your callback.

Not available for public chats

Read receipts are disabled in public chats.

Method signature

icon

Handle the response


Output

TypeDescription
UPubnubCallbackStop*
Object on which you can call Stop() to stop receiving updates.

Sample code

Receive updates for read receipts on the support channel.

1#include "Kismet/GameplayStatics.h"
2#include "PubnubChatSubsystem.h"
3
4UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this);
5UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>();
6
7UPubnubChat* Chat = PubnubChatSubsystem ->InitChat("demo", "demo", "my_user");
8
9UPubnubChannel* Channel = Chat->GetChannel("support");
10
11// Create a pubnub response delegate
12// you MUST implement your own callback function to handle the response
13FOnPubnubChannelStreamReadReceiptsReceived ReadReceiptsUpdatesOnResponse;
14ReadReceiptsUpdatesOnResponse.BindDynamic(this, &AMyActor::OnReadReceiptsResponseReceived);
15
show all 19 lines
Last updated on