I'm using PushBot as my push notification service, my issue is how do I reset the badge count. I've search and read to use this line of code:
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
The only way the badge count gets reset is if I quit the app from running on the mulit-task bar and launch the app again, any help is greatly appreciated. Thanks,
Go to Settings and open Notifications. Scroll down and tap on Messages. To disable notifications altogether, toggle off Allow Notifications. To remove badges, turn off the toggle next to Badges.
It even has a way to display Badge Count in Pure Android devices desktop. Updating the Badge Count in the application icon is as easy as calling: int badgeCount = 1; ShortcutBadger. applyCount(context, badgeCount);
The iOS badge count displays the number of unread notifications within your application, taking the form of a red circle in the upper-right hand corner of the app icon. In recent years, badging has come to be an effective means for re-engaging app users.
To clear the badge count whenever the application becomes active, simply include your line of code:
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
In the AppDelegate.m
file's applicationDidBecomeActive
delegate method.
applicationDidFinishLaunchingWithOptions
is only called on the initial launch, and does not get called again when the application goes to the background and back to the foreground.
For Swift 3.0
//AppleDelgate.swift
func applicationDidBecomeActive(_ application: UIApplication) {
//....
application.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