When notification reach the application, there is no action on badge number. I set background mode on Capabilities.
And there is another problem. This metod does not invoke when app is background mode.
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
print("Push notification received2: \(userInfo)")
completionHandler(UIBackgroundFetchResult.noData)
}
PS: UIApplication.shared.applicationIconBadgeNumber is not answer. I know that. The problem is even the push notification received by application, the badge number does not update.