[Xamarin - iOS] WebView 無法載入 http 的網址

  • 433
  • 0
  • 2017-10-27

在 iOS9 之後,webview 預設只能載入 https 的網址,如果要可以載入 http 網址,要修改 Info.plist

在 Info.plist 加入下面這段即可

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

參考網址:https://stackoverflow.com/questions/31216758/how-can-i-add-nsapptransportsecurity-to-my-info-plist-file