1 Reply
      Latest reply on Sep 16, 2019 3:09 PM by kanishka_408
      min.kwon14 Level 1 Level 1 (0 points)

        Hi, I have an app that receives push notification from server with "content-available": 1


        and i have set my app to increase badge count as soon as it receives push notifications like

        func application(
                _ application: UIApplication,
                didReceiveRemoteNotification userInfo: [AnyHashable : Any],
                fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
            ) {
                  let badgeNumber = UIApplication.shared.applicationIconBadgeNumber + 1       
                  UIApplication.shared.applicationIconBadgeNumber = badgeNumber


        so my app shows badge count correctly in any state (active, background, killed) when it is built in Debug.


        But my app is not showing badge count when app is in killed state and it is built in Released.

        (if it is in background mode, badge shows correctly)


        Is there anyway that I can control badge count from app side (not sending "badge" property through push notification)?


        All I need to do is, update badge number as soon as app receives push notifications


        Thanks in advance. Let me know if need more information