0

So for instance, suppose 3 push notification are sent to an app. The push notifications would not include a badge count, because we want the badge count to be managed on the client.

When one notification comes in, the badge on the app is set to 1. When two more come in, the badge is increased to three.

Then, when a user swipes away a notification, the badge count is decremented back to 2. Thus, the badge itself doesn't show any number calculated by the server pushing the notification, but rather, the number of non-dismissed notifications on the client.

Is that possible in iOS?

Ken Kinder
  • 12,654
  • 6
  • 50
  • 70
  • As far as I'm aware there no way to run code when a user merely swipes away a notification, so I don't think this is possible. – Wernzy Jun 03 '20 at 16:51
  • Not sure if this is what you need, but in this page, they are adding a custom dismiss action: https://developer.apple.com/documentation/usernotifications/declaring_your_actionable_notification_types – koen Jun 03 '20 at 16:55
  • @koen is there a way, when the app does run, to determine how many notifications have not been dismissed even if the code doesn't run when it happens? – Ken Kinder Jun 03 '20 at 17:54
  • You mean when your app is terminated? Sorry, not sure if that is possible. – koen Jun 03 '20 at 18:24
  • Thanks, @koen. I guess "no, that's not possible" is the answer itself then. – Ken Kinder Jun 04 '20 at 13:03
  • @KenKinder Maybe it *is* possible, but I wouldn't know how. – koen Jun 04 '20 at 13:08

0 Answers0