title: Google Authentication - User agent gives error on WebView (Nylas api)
body: <p>We are using <strong>Nylas api</strong> to get Access token for different type of <code>Email account like Gmail, Outlook</code>.. But We couldn't authenticate for <code>Gmail</code>. </p>
  
  <pre><code>        let myURL = URL(string: getNylasAuthUrl())
          let userAgent = getUserAgentParams()
          webView.customUserAgent = userAgent
          let myRequest = URLRequest(url: myURL!)
          webView.load(myRequest)
  </code></pre>
  
  <p>got below error </p>
  
  <p><a href="https://i.stack.imgur.com/x2d4U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x2d4U.png" alt="enter image description here"></a></p>
  
  <p>Finally found a way, by setting User-Agent, we could do authentication for gmail <a href="https://stackoverflow.com/questions/478387/change-user-agent-in-uiwebview-iphone-sdk">from post</a> </p>
  
  <p>Tried below User-agents but didn't help </p>
  
  <pre><code>let userAgent =  "Mozilla/5.0 (Apple \(Utils.getDeviceModel()) ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
  let userAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
  let userAgent = "Mozilla/5.0 (Google) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
  </code></pre>