> For the complete documentation index, see [llms.txt](https://docs.bird.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bird.com/api/client-sdks/app-inbox/usage.md).

# Usage

The `bird.appinbox` is the main entry point for app inbox in Bird client SDKs. Through which you can do the following:

* Get messages
* Listen to incoming messages
* Mark message as read

## Get messages

{% tabs %}
{% tab title="Android" %}

<pre class="language-kotlin"><code class="lang-kotlin"><strong>// getAppInboxMessages() returns a flow which you can gradually consume
</strong><strong>bird?.appInbox?.getAppInboxMessages()?.collect { message ->
</strong><strong>  println("Message: $message")
</strong><strong>}
</strong>
<strong>// or you can consume the whole flow into one list
</strong><strong>val allMessages = bird?.appInbox?.getAppInboxMessages()?.toList()
</strong>
</code></pre>

{% endtab %}
{% endtabs %}

## Listen to incoming messages

App inbox messages will arrive in real-time when the client application is opened. You can listen to incoming messages as shown in this example

{% tabs %}
{% tab title="Android" %}

<pre class="language-kotlin"><code class="lang-kotlin"><strong>// incoming is a Channel&#x3C;AppInboxMessage> through which you can
</strong><strong>// listen to incoming messages
</strong><strong>bird?.appInbox?.incoming?.consumeEach { message ->
</strong><strong>  println("Message: $message")
</strong><strong>}
</strong>
</code></pre>

{% endtab %}
{% endtabs %}

## Mark message as read

Each message has a `readAt` field to indicate whether is read or unread and when the message was read. You can mark a message as read by calling `bird.appinbox.markMessageRead(message)`.

{% tabs %}
{% tab title="Android" %}

<pre class="language-kotlin"><code class="lang-kotlin"><strong>// markMessageRead() marks the message as read
</strong><strong>bird?.appInbox?.markMessageRead(message)
</strong>
</code></pre>

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.bird.com/api/client-sdks/app-inbox/usage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
