How do I badge my app icon

Your application's icon is actually a badge capable of displaying a number. You can use it as a way to show a count of notifications or any other number that is significant for your application:

Here's how to increment the badge count:

    // get a reference to the app's UI Container
    const { ui } = this.props.dpapp
    ui.badgeCount++;

    //show the count
    ui.showBadgeCount();

The following snippet shows how to decrement the badge count:

    // get a reference to the app's UI Container
    const { ui } = this.props.dpapp
    ui.badgeCount--;

    //hide the count
    if (ui.badgeCount === 0) {
        ui.hideBadgeCount();    
    }

For more information, please check the reference docs: https://deskpro.github.io/apps-sdk-core/reference/UIFacade.html

Last updated