0

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?

4

2 回答 2

2
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


}
于 2018-01-04T01:03:40.357 回答
0

由于安装后没有呼叫您的应用程序,因此您无法执行此操作。

您可能可以在application:didFinishLaunchingWithOptions:方法中做到这一点。在这里您可以检查您的应用程序是否更新或清除图标徽章。

于 2012-06-14T09:18:55.940 回答