> ## Documentation Index
> Fetch the complete documentation index at: https://gleanfeed.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Unread count

> Show a native badge or 'What's new' dot for signed-in customers.

`unreadCount()` returns the signed-in customer's unread Glean Feed count so you can show a native badge or a "What's new" dot. Anonymous or stale identity returns `0`.

```swift theme={null}
let count = (try? await GleanFeed.unreadCount()) ?? 0
badge.text = count > 0 ? "\(count)" : nil
```

## Behavior

| Situation                              | Returns                                      |
| -------------------------------------- | -------------------------------------------- |
| Signed-in customer with unread updates | the count                                    |
| Anonymous / not identified             | `0`                                          |
| Stale or invalid identity              | `0` (no error)                               |
| Network or server error                | throws — use `try?` to leave the badge as-is |

<Note>
  There's no push, background polling, or app-icon badging in v1. Call `unreadCount()` from your own
  foreground refresh (for example, on `scenePhase` becoming active) when you want a fresh value.
</Note>

## Confirm the count

Identify a test customer, create an unread reply, status change, comment, or published update for that customer, then call `unreadCount()` while the app is active. Confirm the native badge becomes nonzero. In the portal notification bell, open or mark a personal notification read; for a published update, open the bell so Glean Feed advances the changelog seen marker. Refresh `unreadCount()` and confirm the count changes.
