How to Set the App Icon Badge Count in Your Expo App

DavidDavid November 25, 2026 7 min read
A blank smartphone lying on a pale oak desk beside a small round red enamel button, a ceramic cup and a stack of white index cards in bright morning light
Original image, App Store Launch Club

How to set the app icon badge count in your Expo app, in short

Install expo-notifications with npx expo install expo-notifications. Request notification permission with Notifications.requestPermissionsAsync(), which by default asks to show alerts, set the badge and play sounds. Then call Notifications.setBadgeCountAsync(3) to put a 3 on your app icon and Notifications.setBadgeCountAsync(0) to remove it. Notifications.getBadgeCountAsync() tells you what is currently showing.

The badge is the small red number on the corner of your app icon. It is the cheapest re-engagement feature you can add: no extra screen, no copy to write, just a quiet signal on the home screen that something is waiting. It is also easy to get wrong, because the call can fail without throwing and the number can drift out of sync with what is actually unread.

The badge API at a glance

expo-notifications badge methods and fields (SDK 58)

WhatHow it behaves
setBadgeCountAsync(count)Sets the number on the app icon. 0 clears it. Resolves to true or false depending on whether it worked
getBadgeCountAsync()Resolves to the number currently showing. 0 means no badge is shown
requestPermissionsAsync()Asks for alerts, badge and sounds by default. On iOS you can be explicit with ios: { allowBadge: true }
badge in a push messageiOS only. The number to display on the icon. 0 clears it
badge in local notification contentThe badge number associated with a notification you schedule on the device
shouldSetBadge in the notification handleriOS only. Controls whether a notification that arrives while the app is open updates the badge

Step 1: Install expo-notifications and ask for permission

Run npx expo install expo-notifications. You do not need a separate package for the badge, it lives in the notifications library. If you already followed our guide to adding push notifications to your Expo app, it is installed.

On iOS, the badge is a notification permission. Calling setBadgeCountAsync before you have requested the allowBadge permission makes it return false without changing anything. The default requestPermissionsAsync() call already includes badges, so the usual setup covers it. If you build the request yourself, include allowBadge: true in the ios object along with allowAlert and allowSound.

  • Ask at a moment that makes sense, not on cold launch. Right after the user does something that will produce updates, like following a thread or starting an order, is a good moment. Our guide to requesting permissions in your Expo app covers the timing.
  • On iOS, read ios.status rather than the top-level status. iOS has more states than granted or denied, including provisional and ephemeral authorization.
  • Remember the user can allow notifications but turn badges off. The top-level status stays granted in that case, and ios.allowsBadge from getPermissionsAsync() is false.

Step 2: Set and clear the badge from your app

Once permission is in place, setting the badge is one line: const ok = await Notifications.setBadgeCountAsync(unreadCount). Pass the real count, not an increment, and pass 0 when there is nothing left to see. Always keep the boolean it returns. False tells you the badge did not change.

  1. When the app comes to the foreground, fetch the true unread count from your backend or local database and call setBadgeCountAsync with it.
  2. When the user opens the inbox, thread or screen the badge represents, call setBadgeCountAsync(0), or the new lower count.
  3. When the user logs out, clear it with setBadgeCountAsync(0). A badge left over from another account looks like a bug.
  4. If a call returns false, log it once. On iOS it usually means badge permission was never requested. On Android it usually means the launcher does not support badges.

Step 3: Keep the badge in sync with push notifications

Most badges change while the app is closed, which means a push notification has to carry the number. When you send through the Expo push service, add a badge field to the message. On iOS, that field is the number to display on the icon, and 0 clears it. It is not an amount to add to whatever is there now, so your server needs to know each user's real unread count when it sends.

  • Store an unread count per user on your server and include it as badge on every push that should change the icon.
  • When the user reads something in the app, update the server count as well as calling setBadgeCountAsync, or the next push will put the old number back.
  • On iOS, the system only sets the badge if the user allows badges. If a push arrives with no badge change, check ios.allowsBadge before you go debugging your server.
  • The badge field in the Expo push message is iOS only. On Android, whether and how a badge appears is up to the launcher.

Local notifications work the same way. When you schedule one with scheduleNotificationAsync, you can set badge in the notification content to associate a badge number with it. That is useful for reminder apps where the count is known in advance on the device.

One more detail for notifications that arrive while your app is open. Your setNotificationHandler callback returns shouldSetBadge, which is iOS only and decides whether that notification updates the badge. Expo's own example sets it to false. Until your app sets a handler, a notification is shown with the badge from the notification. If your app updates the count itself when it is in the foreground, setting shouldSetBadge to false keeps the two from fighting.

What is different on Android

Not every Android launcher supports app icon badges. On a launcher that does not, getBadgeCountAsync always resolves to 0 and setBadgeCountAsync resolves to false. That is expected, not an error in your code, so do not build a feature that depends on a number showing on Android.

Android also ties badges to notification channels. A channel has a showBadge setting, so if you create channels with setNotificationChannelAsync, decide per channel whether its notifications should mark the icon. A channel for chat messages probably should. A channel for marketing almost certainly should not.

Why your badge is not showing

SymptomMost likely cause
setBadgeCountAsync returns false on iPhoneBadge permission was never requested. Call requestPermissionsAsync first
Permission is granted but no badge appears on iPhoneThe user turned badges off for your app in Settings. Check ios.allowsBadge
setBadgeCountAsync returns false on AndroidThe launcher does not support icon badges
Badge jumps back to an old numberThe server's unread count was not updated when the user read something, so the next push resent the old number
Badge never clearsNothing calls setBadgeCountAsync(0) when the user opens the relevant screen or logs out
Push arrives on Android but the icon shows no numberThe badge field in the push message is iOS only, and badge support depends on the launcher

Have Claude Code set it up for you

Open your project in the Claude Code desktop app and describe the whole flow, including where the count comes from and when it clears:

Then test the edges by hand: deny permission and check the app still works, mark everything read and confirm the badge clears, log out and back in as someone else. Add a line to your CLAUDE.md such as "Badge: only src/lib/badge.ts touches the app icon badge, and it always gets the full unread count" so a later session does not start incrementing it somewhere else.

The short version

Setting the app icon badge in Expo is one package and two functions. The part that takes thought is the number itself: count only what the user cares about, send the full count rather than an increment, and clear it the moment they catch up. Get that right and the badge brings people back without annoying them.

If you are building your first iOS app with Claude Code and Expo and want help getting features like this right before launch, bring it to App Store Launch Club. Members share their builds and help each other get unstuck, and the curriculum covers the full path from first build to first users. Pair this with our guides to adding push notifications, requesting permissions and running background tasks in your Expo app. Join at applaunchclub.co for $9 a month.

Free app-building tips, straight to your inbox

Short, practical drops on app ideas, validating fast, store listings, and passing app review. No spam, unsubscribe anytime.

Frequently asked questions

How do I set the app icon badge count in Expo?

Install expo-notifications, request permission with Notifications.requestPermissionsAsync(), then call Notifications.setBadgeCountAsync with the number you want to show. Pass 0 to clear the badge.

Why does setBadgeCountAsync return false?

On iOS it returns false if your app has not requested the allowBadge permission through requestPermissionsAsync. On Android it returns false when the device's launcher does not support app icon badges.

How do I clear the app badge in Expo?

Call Notifications.setBadgeCountAsync(0). Do it when the user opens the screen the badge represents and when they log out. If you send push notifications, also reset the count on your server so the next push does not bring the old number back.

Does the badge field in a push notification add to the current badge?

No. In an Expo push message, badge is the number to display on the app icon on iOS, and 0 clears it. Your server needs to send the user's full unread count each time.

Does the app icon badge work on Android?

Only on launchers that support icon badges. On launchers that do not, getBadgeCountAsync always returns 0 and setBadgeCountAsync returns false. The badge field in Expo push messages is iOS only.

Why is permission granted but the badge still does not show on iPhone?

The user can allow notifications and turn badges off. The top-level permission status stays granted in that case. Check ios.allowsBadge from getPermissionsAsync() to see whether badges are allowed.

Last reviewed by David on November 25, 2026

David

Written by

David

Founder and app builder

Keep reading

ExpoClaude Code

How to Add Notification Actions to Your Expo App

To add notification actions to an Expo app, register a category with Notifications.setNotificationCategoryAsync, give it action buttons (and optionally a text reply), set categoryIdentifier on the notification, then read response.actionIdentifier in a response listener. Here is every action option, how to handle taps when the app was closed, the Android and iOS differences, and a Claude Code prompt that wires it all up.

David 8 min
Read article
ExpoClaude Code

How to Schedule Local Notifications in Your Expo App

To schedule local notifications in an Expo app, install expo-notifications, set a notification handler, ask for permission, create an Android channel, then call scheduleNotificationAsync with your content and a trigger like DAILY, WEEKLY or DATE. Here is every trigger type, how to cancel and list what is scheduled, why Android reminders arrive late, and a Claude Code prompt that builds the whole reminder flow.

David 8 min
Read article

Ready to build it yourself?

Join App Store Launch Club, the #1 community for building and launching apps, for $9/month.

← Back to the blog