title: How can I update users FCM token if their current one no longer works?
body: <p>I discovered an issue with my application, certain users stopped receiving push notifications for awhile. Their FCM token that is associated with their account seems to either have expired or they need a new one. I tested by deleting the app on my device and I was issued a new fcm token in Xcode. </p>
  
  <p>I copied that FCM token from the Xcode console and manually replaced it with the one I had in Firebase database, I then was able to successfully receive push notifications. </p>
  
  <p>My question, is it possible to renew current users FCM token when they sign back into/ or open the app again so they can receive push notifications successfully? </p>
  
  <p>Here is my app delegate </p>
  
  <pre class="lang-swift prettyprint-override"><code>
  
   func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {
  
       attemptRegisterForNotifications(application: application)
          Messaging.messaging().delegate = self
  
          return true
      }
  
     func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
          print("Registered for notifications", deviceToken)
          Messaging.messaging().apnsToken = deviceToken
  
      }
  
  
  
      func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
          print("Registered with FCM with token:", fcmToken)
      }
  
      // Listen for user notifcations
      func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -&gt; Void) {
          completionHandler(.alert)
      }
  
  
      private func attemptRegisterForNotifications(application: UIApplication) {
          print("Attempting to register APNS...")
  
          UNUserNotificationCenter.current().delegate = self
  
  
          let options: UNAuthorizationOptions = [.alert, . badge, .sound]
          UNUserNotificationCenter.current().requestAuthorization(options: options) { (granted, error) in
              if let error = error {
                  print("Failed to request auth:", error)
                  return
              }
  
              if granted {
                  print("Auth granted.")
              } else {
                  print("Auth denied")
              }
  
          }
  
          application.registerForRemoteNotifications()
  
  
      }
  
  
  </code></pre>