Apps Developer Guide (Old)
  • Introduction
  • Create your first app in 4 easy steps
  • Overview
    • How does it work ?
    • Documentation
    • Deskpro Apps Tool
  • SDK
    • The Application Manifest
      • Manifest Reference
    • Storing data
      • Storing ticket data
    • Accessing the Deskpro REST API
    • Accessing remote services
    • The Application Installer
    • Application Contexts
      • ContextDataObject Reference
    • Events
  • Guides
    • Create an Oauth2 integration
    • Using an API Key to read data
  • Application Context
    • Get the authenticated user
    • Access Custom Fields
    • Interacting with the Host UI Container
  • Application Container
    • How do I badge my app icon
  • HTTP
    • How do I use a remote web service
  • OAuth2
    • How do I customize OAuth2 requests
  • UI Patterns
    • How do I split my app into different screens
Powered by GitBook
On this page
  1. Application Container

How do I badge my app icon

PreviousInteracting with the Host UI ContainerNextHow do I use a remote web service

Last updated 6 years ago

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