Announcements API

Description

This JS API provides you access to announcements. Access methods on this object:

productFruits.api.announcementsV2

Methods


Pop-ups only

productFruits.announcementsV2.showAnnouncement('popupID')

Displays a specific pop-up announcement based on its unique identifier.
The unique popupID identifier can be extracted from the pop-up announcement's detail page URL (the segment immediately following /detail/). popupID must be a string.
 



Newsfeed only

productFruits.announcementsV2.attachNewsWidgetToElement(htmlElementInstance)

Attaches the newsfeed widget to a custom element. The parameter must be an HTML element instance, do not pass a CSS selector.



All types of announcements

productFruits.announcementsV2.listen(event, callback)

Listens to an event related to announcements. See the next section for event names.


Events


Newsfeed only

newsfeed-unread-count-changed

Data 
- count
- listCheckedAt

Fired when the count of unread items changes. Use this to show badge of unread items in your custom newsfeed launcher button.

Was this article helpful?