I am using iOS 10 with swift 2.3 I need to increase badge count when receiving new notification from firebase. I have code to increase badge count
let badgeCount: Int = BadgeCount + 1
UIApplication.sharedApplication().applicationIconBadgeNumber = badgeCount
But I don't know where to use it to make it work correctly.
If you are using Firebase push notification we just need to enable iOS badge and include badge count before sending. In AppDelegate.Swift
, in the applicationDidBecomeActive
function we need to add
UIApplication.sharedApplication().applicationIconBadgeNumber = 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With