# How to add a notification badge to your app icon?

## Android <a href="#h_9c6186342e" id="h_9c6186342e"></a>

On Android (8.0 and higher), notification badges (or "notification dots") are automatically displayed on your app icon when users have unread push notifications. Users can long-press on the app icon to see the list of unread notifications.

<figure><img src="/files/NfXZXPw95Oj8fUqWwl3y" alt=""><figcaption></figcaption></figure>

Android's notification badges are simple **colored dots**. This doesn't allow users to know how many unread push notifications they have for a specific app.&#x20;

{% hint style="info" %}
Some device manufacturers may add an unread notifications count to their custom Android interfaces (e.g. Samsung, Xiaomi, etc). When this is the case, the system will increment or decrease the value displayed on each app icon automatically.
{% endhint %}

## iOS <a href="#h_c313df66f0" id="h_c313df66f0"></a>

Batch allows you to display a badge in the top right corner of your iOS app icon when your users receive a new notification. Here is how it looks:

<figure><img src="/files/oKIxS1J7cABAUOgKKyHT" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Badge counts are especially useful to show your users that new content is available in your app. This is a simple way to **re-engage users** and create more visits in a **non-intrusive way.**
{% endhint %}

You can add a badge to your notifications on iOS:

* **From the Dashboard**
* **Via the Transactional or Campaigns API**.

## From the Dashboard <a href="#h_62f2fc5bf2" id="h_62f2fc5bf2"></a>

You set a badge count (e.g. 99) by copying/pasting the following code in **Advanced settings > Payload**:

```
{"aps":{"badge":99}}
```

<figure><img src="/files/gZdMVYYjMOt5vnfqpD2n" alt=""><figcaption></figcaption></figure>

## Using the Campaigns API <a href="#h_3e96d86919" id="h_3e96d86919"></a>

This can be easily achieved by adding the same code to the `custom_payload` field. Here is how it looks for a new campaign:

```
"messages": [
    {
      "channel_type": "push",
      "platform_type" : ["ios","android"],
      "title": "The campaign title",
      "body": "The campaign body",
      "ios": {
        "deep link": "https://example.com/",
        "custom_payload": "{\"aps\":{\"badge\":2}}"
      "android": {
        ...
      }
    }
  ]
```

Find more information on how to use our API in the [dedicated documentation](https://doc.batch.com/developer/api/cep/campaigns).

## Incrementing the badge value <a href="#h_6221a8cf82" id="h_6221a8cf82"></a>

iOS allows you to set a specific value for the badge count (e.g. 0, 3, 99) but doesn’t provide any mechanics to automatically increment or decrement the value displayed on your app icon when a notification is received.

{% hint style="warning" %}
You could handle that issue by saving remotely the most recent value of the badge for each install, and resetting it once the app is opened. \
We usually **recommend against it** as the badge may be reset while the device is offline.
{% endhint %}


---

# 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://doc.batch.com/guides-and-best-practices/message/push-notifications/how-to-add-a-notification-badge-to-your-app-icon.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.
