# 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>
</strong><strong>// or you can consume the whole flow into one list
</strong><strong>val allMessages = bird?.appInbox?.getAppInboxMessages()?.toList()
</strong><strong>
</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><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><strong>
</strong></code></pre>

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
