title: Pass Token Through URL into Webview IOS Swift
body: <p>Hello I am using webview to display my contents on my app. I successfully registered with firebase. Now I want to pass the registration token through URL to store into DB for custom notification. </p>
  
  <p><strong>appdelegate.swift</strong></p>
  
  <pre><code>func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
      let token = deviceToken.map {String (format: "%02.2hhx", $0)}.joined()
      print(token)
  }
  </code></pre>
  
  <p><strong>Firebase</strong></p>
  
  <pre><code>extension AppDelegate: MessagingDelegate {
  func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) {
      print("Firebase registration token: \(fcmToken)")
  
      //Saving fcmToken to pass to the url
      let preferences = UserDefaults.standard
      preferences.setValue(fcmToken, forKey: "token")
      preferences.synchronize()
  
  
      let dataDict:[String: String] = ["token": fcmToken]
      NotificationCenter.default.post(name: Notification.Name("FCMToken"), object: nil, userInfo: dataDict)
      // TODO: If necessary send token to application server.
      // Note: This callback is fired at each app startup and whenever a new token is generated.
  }
  </code></pre>
  
  <p>and this is for <strong>viewcontroller.swift</strong></p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
      //Retrieving the fcmToken
      let prefs = UserDefaults.standard
      let token = prefs.string(forKey: "token")
      //?token= \(token as Optional)&amp;device=ios
      webView.load(URLRequest(url: URL(string: "https://instaglamexpress.com/app/customer/?device=ios&amp;token=\(String(describing: token))")!))
  }
  </code></pre>
  
  <p>I am unable to send Token into URL..</p>
  
  <p>please suggest the solution. </p>