1

I have a problem. my app icon badge is not incrementing when a notification fires. i can only set

localNotification.applicationIconBadgeNumber

to 0 or 1.

if i set

localNotification.applicationIconBadgeNumber = localNotification.applicationIconBadgeNumber + 1

Badge number updates only the first time, and then remain at its value.

There is a method to increment that value?i have searched internet but i can't figure out how solve this problem.

thank you in advance!

Swift1
  • 349
  • 1
  • 4
  • 22

2 Answers2

0

Try to set that badge number with the UIApplication singleton object, instead of assigning a counter to a local notification.

Anticro
  • 685
  • 4
  • 12
  • i tried application.applicationIconBadgeNumber = application.applicationIconBadgeNumber + 1 in the app delegate.swift file but the problem still persists... – Swift1 Dec 11 '15 at 22:58
0

Just check out my answer on this topic: https://stackoverflow.com/a/55615254/11340995 The secret is to increment

cseh_17
  • 194
  • 2
  • 10