0

I just got push notifications working with my app. It's a Post/Comment style application. If someone answer a users Post, they are sent a push notification. I WANT 1 to be added to the badge. However the value I send appears to SET as oppose to ADD.

If I then want to ADD, is the only way to do so by keeping track of unread comments server side, and then before I send the push notification, tally the amount of unread comments owned by the users, add 1 to it, and then send that value? Is there no way to send a value to tally?

How do you properly manage the badge count?

chris P
  • 6,359
  • 11
  • 40
  • 84

1 Answers1

1

You can keep track on the server. This could be the most simple and effective solution.

If you enable background push then you can pass additional data in the push and handle it in the background in your app to increment the badge, or to download and then update the badge for the new data available.

Wain
  • 118,658
  • 15
  • 128
  • 151
  • ok so there is no way to 'add' correct? I'm going to have to a 'read' column to my comments table, and when the post user reads said comment, set the read column to true? Is this the only way? Sounds like a lot of extra server POSTs to update the read column on the comments table. Is this how I would implement this? – chris P Mar 31 '15 at 21:40
  • Basically, yes. Some services like urban airship offer assistance with this but it's still manually managed. You can upload only when changes have been made and the app goes to background / your view is dismissed. – Wain Apr 01 '15 at 06:39