Hey there,

I am new to Pushwoosh and have been trying to figure out how to display the count of notifications on my app icon and on an icon within the app itself.

I am using phonegap to create the app so my goal is to make this compatible with iOS, Android and Windows. I am able to send notifications to the app perfectly, just having troubles with the notifications count.

I want it to look something like this on the app icon:

alt text

And there should be a place within the app where it should be displayed like this example:

alt text

How do I achieve this?

Thanks in advance!

asked 13 May '14, 19:43
oukpoma's gravatar image

oukpoma
1113

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.

permanent link
answered 14 May '14, 10:28
Dmitry%20%20Dyudeev's gravatar image

Dmitry Dyudeev
3.7k7

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?

(14 May '14, 13:51) oukpoma oukpoma's gravatar image

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

(15 May '14, 14:58) oukpoma oukpoma's gravatar image

@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.

permanent link
answered 11 May '15, 08:57
laustdeleuran's gravatar image

laustdeleuran
1

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×47
×18
×16

question asked: 13 May '14, 19:43

question was seen: 4,873 times

last updated: 11 May '15, 08:57