iosiphonereact-nativespringboard

React Native: What controls number in red circle on app icon on iPhone screen?


When I have apps on my iPhone, if I've received a notification of something in that app, a red circle will appear on the top right of the app icon on my iPhone springboard.

If I'm building a React Native app, what controls this number?


Solution

  • You can use : https://github.com/react-native-push-notification-ios/push-notification-ios

    Setting a badge number is only supported on iOS. Badge number is related to number of push notifications for an app, but you can set a custom number based on some other logic like rn-firebase.

    applicationIconBadgeNumber The number to display as the app's icon badge. The default value of this property is 0, which means that no badge is displayed (optional).

    This tutorial seems to nail all the portions , but you might want to update the code used in the article.

    Update: Use react-native-notification-badge if you don't want a fully featured notification manager.