WKWebView 403エラー:許可されていないuseragent

1403 ワード

403エラー:許可されていないuseragent
Google can't sign you in safely inside this app. You can use Google sign-in by visiting this app's website in a browser like Safari or Chrome.
Webビューでは、GoogleへのOAuthリクエストは許可されていません.
たとえば、)
AndroidのWebビューUI要素、iOSのUIWebView/WKWebView、Windows、OS Xの対応する要素
ユーザー・エージェントのバイパスの解決
https://stackoverflow.com/questions/26994491/set-useragent-in-wkwebview
let webConfiguration = WKWebViewConfiguration()
webConfiguration.applicationNameForUserAgent = "ExampleApp/1.0 (iPhone)"
let webView = WKWebView(frame: .zero, configuration: webConfiguration)