---
source_url: https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/read-receipts
title: Read receipts
updated_at: 2026-06-19T11:35:22.734Z
---

> 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


# Read receipts

Read receipts show if channel members have viewed a message.

:::note Required setup
Read Receipts requires [Unread Message Count](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/unread). First, [set the last read timetoken](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/messages/unread#mark-messages-as-read-one-channel) for each user on a channel.
:::

## Stream read receipts

`StreamReadReceipts()` provides real-time read status for messages on a channel. Use `OnReadReceiptEvent` to handle updates.

:::warning Not available for public chats
Read receipts are disabled in [public chats](https://www.pubnub.com/docs/chat/unity-chat-sdk/build/features/channels/create#create-public-channel).
:::

:::tip Method naming
Earlier versions used `SetListeningForReadReceiptsEvents()` to enable streaming. This method has been superseded by `StreamReadReceipts()`, though it remains available for backward compatibility.
:::

### Method signature

These methods take the following parameters:

* StreamReadReceipts() 1channel.StreamReadReceipts(bool stream)
* OnReadReceiptEvent - Event signature 1// event on the Channel entity — enabled by StreamReadReceipts()2public event Action<ReadReceipt> OnReadReceiptEvent;3// needs a corresponding event handler4void EventHandler(ReadReceipt readReceipt)

#### Input

| Parameter | Required in StreamReadReceipts() | Required in OnReadReceiptEvent | Description |
| --- | --- | --- | --- |
| stream | bool | Optional |  | Yes | n/a | Whether to start (`true`) or stop (`false`) listening to read receipt events on the channel. |
| readReceipt | ReadReceipt | Optional |  | No | Yes | Typed read receipt data containing the user ID and the last read timetoken. |

#### Output

These methods don't return a value. Read receipt updates are delivered through the `OnReadReceiptEvent` event handler.

### Sample code

Receive updates for read receipts on the `support` channel.

```csharp
using System.Collections.Generic;
using System.Threading.Tasks;
using PubnubApi;
using PubnubChatApi;
using UnityEngine;

// Configuration
PubnubChatConfig chatConfig = new PubnubChatConfig();
        
PNConfiguration pnConfiguration = new PNConfiguration(new UserId("myUniqueUserId"))
{
    SubscribeKey = "demo",
    PublishKey = "demo",
    Secure = true
};

// Initialize Unity Chat
var chatResult = await UnityChat.CreateInstance(chatConfig, pnConfiguration);
if (!chatResult.Error)
{
    chat = chatResult.Result;
}
// reference the channel where you want to listen to message signals
var channelResult = await chat.GetChannel("support");
if (!channelResult.Error)
{
    var channel = channelResult.Result;
    Debug.Log($"Found channel with name {channel.Name}");

    // join the channel and start listening to read receipt events
    await channel.JoinChannel();
    channel.Connect();
    channel.StreamReadReceipts(true);

    // subscribe to the OnReadReceiptEvent event
    channel.OnReadReceiptEvent += OnReadHandler;
}
else
{
    Debug.Log("Channel not found");
}
        
// the event handler
void OnReadHandler(ReadReceipt readReceipt)
{
    // print the message details to the console
    Debug.Log(
        $"Received a read receipt event for timetoken {readReceipt.LastReadTimeToken}" +
        $" from user {readReceipt.UserId}");  
    // you can add additional logic here, such as confirming receipt to the user or processing the message further
}
```

## Get read receipts

`GetReadReceipts()` retrieves a snapshot of read receipts for all members of a channel.

### Method signature

This method has the following signature:

```csharp
channel.GetReadReceipts(
    string filter = "",
    string sort = "",
    int limit = 0,
    PNPageObject page = null
)
```

#### Input

| Parameter | Description |
| --- | --- |
| `filter`Type: `string`Default: `""` | Expression to filter results. |
| `sort`Type: `string`Default: `""` | Key-value pair of a property to sort by and a sort direction. |
| `limit`Type: `int`Default: `0` | Number of results to return. When set to `0`, uses the default server value. |
| `page`Type: `PNPageObject`Default: `null` | Object used for pagination. |

#### Output

| Type | Description |
| --- | --- |
| `Task<ChatOperationResult<List<ReadReceipt>>>` | An awaitable `Task` returning a list of `ReadReceipt` objects, each containing a `UserId` and `LastReadTimeToken`. |

## Configure read receipt emission

Control which channel types emit read receipt events by setting `EmitReadReceiptEvents` in `PubnubChatConfig` when initializing the Chat SDK. Keys are channel type strings (`"public"`, `"group"`, `"direct"`, or any custom type); values are booleans. By default, read receipts are enabled for `group` and `direct` channels and disabled for `public` channels.

### Sample code

```csharp
using System.Collections.Generic;
using System.Threading.Tasks;
using PubnubApi;
using PubnubChatApi;
using UnityEngine;

// Configuration
PubnubChatConfig chatConfig = new PubnubChatConfig();
        
PNConfiguration pnConfiguration = new PNConfiguration(new UserId("myUniqueUserId"))
{
    SubscribeKey = "demo",
    PublishKey = "demo",
    Secure = true
};

// Initialize Unity Chat
var chatResult = await UnityChat.CreateInstance(chatConfig, pnConfiguration);
if (!chatResult.Error)
{
    chat = chatResult.Result;
}
// set read receipt emission rules per channel type when creating Chat object
var chatConfig = new PubnubChatConfig()
{
    EmitReadReceiptEvents =
    {
        { "public", false },
        { "group", true },
        { "direct", true },
        { "some_custom_type", true },
    }
};
var pubnubConfig = new PNConfiguration(new UserId("some_user"))
{
    PublishKey = "your_publish_key",
    SubscribeKey = "your_subscribe_key",
};
var createChat = await UnityChat.CreateInstance(chatConfig, pubnubConfig);
if (createChat.Error)
{
    Debug.LogError($"Error when trying to create Chat instance: {createChat.Exception.Message}");
    return;
}
var chat = createChat.Result;
```