Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift- Remove Push Notification Badge number?

Tags:

swift

I am trying to remove the icon badge in swift, but PFInstallation doesn't seem to work anymore. How do I do this?

like image 910
ByteDuck Avatar asked Jan 04 '15 18:01

ByteDuck


People also ask

How do I delete a notification number on my iPhone?

How to Disable Red Number Badges on iPhone or iPad. To disable these annoying number badges, head to Settings > Notifications on your iPhone, and then scroll down to the app you want to turn the notifications badge off for and select it. I'm using Airmail in this example. Toggle the Badge App Icon switch off.

How do I get rid of number notifications on Android app icon?

To Remove Unread Counts from App Icon Badges To do so, tap anywhere on the "App icon badges" menu item except its toggle, and you'll see more options. Then, change the badge style from showing numbers to "Dot" (on Android 10–12) or "Show without number" (on Android 8–9).


1 Answers

You can "remove" the app badge icon by setting it to 0:

Swift < 3.0

UIApplication.sharedApplication().applicationIconBadgeNumber = 0 

Swift 3.0+

UIApplication.shared.applicationIconBadgeNumber = 0 

This question shows when you can use it: How to clear push notification badge count in iOS?

like image 129
Oxcug Avatar answered Sep 22 '22 17:09

Oxcug