This JS API provides you access to announcements. Access methods on this object:
productFruits.api.announcements
getAnnouncementsByChannel(channelId)
Returns an array of announcements by a given channel ID. The announcement object contains id
, publishedAt
, titles
and userState
fields.
Possible userState
values are not_seen
(the user haven't seen the announcement yet) or seen
(the user skipped the tour).
The titles
object contains an object with all titles in all given languages. The key of this object is the ISO language identifier (i.e. en
for English).
showAnnouncement(id)
Shows the content of the given announcement by its ID. Currently, only the modal-type announcements are supported by this API.
showHistory(channelId)
Shows the history modal of the given channel ID.
listen(event, callback)
Listens to an event that occurs on tours. See the next section to get event names.
banner-spacing
Argument Space in pixels
Fired when the banner-type announcement is showing. The argument gives you space in pixels that you can use for moving the page down if you don't want to cover your content with the Product Fruits banner.