LoginSignup
4
5

More than 5 years have passed since last update.

WKWebView で http://~~ サイトが表示されない

Posted at

原因: ATSにより https のサイトしか表示できない

iOS9.0 よりATS(App Transport Security) と呼ばれるセキュリティのポリシーが理由でHTTPSしかデフォルトで表示出来ない。

解決策: NSAppTransportSecurity に NSAllowsArbitraryLoads を true で追加する

info.plist
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

GUIで設定する場合

kobito.1472166477.869057.png

他に個別のサイトを指定する方法も有るらしい

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5