Badges
This article covers how to request the unread News Feeds card count and use that information to power badges for your web application.
important:
News Feed is being deprecated. We recommend migrating to our Content Cards messaging channel instead—it’s more flexible, customizable, and reliable. To get started, check out Migrating from News Feed.
Requesting unread News Feed card counts
You can request the number of unread cards at any time by calling:
1
braze.getCachedFeed().getUnreadCardCount();
This is often used to power badges signifying how many unread News Feed cards there are. See the JSDocs for more information. Note that Braze will not refresh News Feed cards on new page loads (and so this function will return 0) until you show the feed or call braze.requestFeedRefresh();
New Stuff!