title: How to disconnect Firebase Notifications on iOS (Swift 3)?
body: <p>I'm working on an App with Firebase Notifications. I have configured it in AppDelegate, and they're working good.</p>
  
  <p>The question: I have a settings view with a switch, to turn on/off notifications, and I don't know how to disable notifications. I've tried this, but is not working:</p>
  
  <pre><code>@IBAction func changeSwitch(_ sender: Any) {
      if mySwitch.isOn {
          print("NOTIFICATIONS ON")
  
          connectToFcm()
  
      } else {
          print("NOTIFICATIONS OFF")
  
          FIRMessaging.messaging().disconnect()
      }
  }
  
  func connectToFcm() {
      FIRMessaging.messaging().connect { (error) in
          if (error != nil) {
              print("Unable to connect with FCM. \(error)")
          } else {
              print("Connected to FCM.")
          }
      }
  }
  </code></pre>
  
  <p>Maybe you can help me.</p>
  
  <p>Thanks!</p>