0

I have looked at plenty of question discussed but the I dint find anyone discussing exactly what I was looking for.

I have a doubt which might be silly, but I need it to understand push notification well.

Suppose if I have some 100 mails and 20 of them are read. Then I will convey the read count someway to server and server will send notification when its needed.

When app is in background, I will be getting 80 as my badge count. If additional two mails are received, and app is still in background, should the server send 2 or should the server send 82?

Will the badge count be automatically updated? Or will always be the badge count sent by the server?

Looking forward for your answers. Please help me out.

aparna
  • 353
  • 2
  • 3
  • 13

1 Answers1

0

What I understood about the badge number roughly is: the number of things you haven't seen yet that happened inside an app.

I recently developed an app that had the push notification feature. What I did and according to your problem, what you have to do is, anytime you read a mail, tell the server to decrement on 1 the badge count. Anytime the server wants to notificate the user another mail has came, the server has to increment that badge count he is storing and send it to you.

So, in the example you're showing, if you have 80 in the badge count and two mails are recieved and the app is still in background, as you haven't read any of the 80 mails, the server should send you 82.

And yes, the badge count will be automatically updated, everytime the server sends a push. I suggest you to make all the badge count in the server side. Everytime the server sends a push, that count (if you developed the push correctly) should be updated automatically.

Hope this answer helped!

FabKremer
  • 2,149
  • 2
  • 17
  • 29