0
votes

my app uses push notification. When I install the app to my device the app icon shows a push notification badge. The badge number remains the same and doesn't update with new notifications.

Is there any way not to show the badge just after installing the app and only when my app receives an actual push notification?

2

2 Answers

2
votes
func applicationDidBecomeActive(_ application: UIApplication) {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    application.applicationIconBadgeNumber = 0


}
0
votes

Since there is not call made to you app after installing you can not do this.

You might be able to do it in the application:didFinishLaunchingWithOptions: method. Here you could make a check if you apps is update or something and clear the icon badge.