Push notification badge behaviour on ios and android

Please provide the following:

  1. SDK Version: 44
  2. Platforms(Android/iOS/web/all): iOS/Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

Hi, I am unsure of badge behaviour on both platforms.

as of now I am using

// Notification handler
Notifications.setNotificationHandler({
    handleNotification: async () => ({
        shouldShowAlert: false,
        shouldPlaySound: false,
        shouldSetBadge: true,
    }),
});

to set notification handler, and after my backend service sends push notification with badge count(which I don’t like).

so right now, I am handling badge count with socket event, whenever app listens on badge handling event, it will call

Notifications.setBadgeCountAsync(count)

Later i found out that Android uses unread notifications as badge count(which is conflicting with my method). I am cool with that and willing to change my app requirements to use unread notification as badge count - but is there a way to achieve the same behaviour on iOS? As of now, I find my method(using socket) to be unreliable, I’d rather let OS handle the badge count. Please share some knowledge since documentation does not provide enough information about badge behaviour. Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.