Notification count icon

Comments

4 comments

  • Avatar
    Dmitry Dyudeev

    Hello,

    Actually, at the moment it is possible out-of-the-box only on iOS and Windows Phone: on iOS, you can use the "ios_badges" section of the createMessage request when sending a notification and setBadge method from the application in order to modify the badge when your user reads some of notifications. On WP, you can use Tile notifications and set the counter.

    On Android, you might try to implement it by yourself, but since Google doesn't support badges at the moment, there is a risk that a lot of devices wouldn't show the badge.

  • Avatar
    Oukpoma

    Thanks for your response. I have implemented a way to store the number of notifications but the only thing I need is to figure out where I can increment my counter. In other words, is there a way I can detect (within the app) when a notification has been received and thus, increment my counter? I tried doing something like this:

    document.addEventListener('push-notification', function(event) { count++; });

    But that works only when the notification is clicked from the phones notification tray. So how can I detect when I open the app that there is a notification that hasn't been viewed?

  • Avatar
    Oukpoma

    Maybe a way to determine when a notification has been received by triggering "document.addEventListener('push-notification', function(event)..." when the app is opened?

  • Avatar
    laustdeleuran

    @Dmitry,

    But - is there any way to keep track of the badge count WITHIN the app? As the OP stated in his comment, the push-notification event listener is a bit unpractical for this purpose.

Please sign in to leave a comment.