title: why I can't remove the badge after receiving notification?
body: <p>I am trying to implement push notification using Firebase Cloud Messaging, I send the message through firebase console. when composing a message in Firebase console, I set the badge number to be 1 like the picture below</p>
  
  <p><a href="https://i.stack.imgur.com/k3R4Y.png" rel="noreferrer"><img src="https://i.stack.imgur.com/k3R4Y.png" alt="enter image description here"></a></p>
  
  <p>after that, my app icon in the home screen will always have badge with number "1", even tough I have tried to uninstall and reinstall it, the badge with number "1" is still there.</p>
  
  <p>but it <strong>only happens in my iPhone</strong>,if I Install it on the other phone, the badge will not show up</p>
  
  <p>I use this code in App delegate to trigger push notification</p>
  
  <pre><code>@UIApplicationMain
  class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate, UNUserNotificationCenterDelegate {
  
      var window: UIWindow?
      var fcmTokenUser : String?
      var firsTimeUsingApp = true
  
      func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
  
          FirebaseApp.configure()
  
  
          print(NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).last! as String)
  
  
          // To get FCM token that will be sent to APNS via Google FCM
          if #available(iOS 10.0, *) {
              // For iOS 10 display notification (sent via APNS)
              UNUserNotificationCenter.current().delegate = self
  
              let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
              UNUserNotificationCenter.current().requestAuthorization(
                  options: authOptions,
                  completionHandler: {_, _ in })
          } else {
              let settings: UIUserNotificationSettings =
                  UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
              application.registerUserNotificationSettings(settings)
          }
  
          application.registerForRemoteNotifications()
  
  
          Messaging.messaging().delegate = self
          let token = Messaging.messaging().fcmToken
          fcmTokenUser = token
  
          checkFirstTimeUsingAppOrNot()
          moveToNextPage()
  
  
  
          // to make status bar in the light mode (in info.plist it also has to be set 'View controller-based status bar appearance' to NO)
          UIApplication.shared.statusBarStyle = .lightContent
  
  
          return true
      }
  
  
  
      func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String){
           // This callback is fired at each app startup (when the user install the app for the very first time) and whenever a new token is generated due to The app is restored on a new device, The user uninstalls/reinstall the app, The user clears app data.
  
          // after fcm generated for the very first time,then fcm can also be retrieved in the 'didFinishLaunchingWithOptions' method above (let token = Messaging.messaging().fcmToken)
  
  
          fcmTokenUser = fcmToken
  
  
  
          moveToNextPage()
  
  
  
      }
  
  
  
  
      private func application(application: UIApplication,
                       didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
          Messaging.messaging().apnsToken = deviceToken as Data
      }
  
  
  
  
  
  }
  </code></pre>
  
  <p>how to resolve this issue?</p>