2

I have Xamarin PCL project where I need to show some HTML content in webview. In Android app everything working perfect, but in IOS I have problem with display images. Because its not local content I disable ATS for the app.

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

Some times I run app webview show image but in most cases its not showing, it just show question mark in a blue square like on attached image.

question mark in a blue square:

enter image description here

Hichame Yessou
  • 2,658
  • 2
  • 18
  • 30
Nia Kovac
  • 35
  • 1
  • could you give the html content? – Yun CHEN Jan 09 '18 at 08:47
  • It is not because it is not local content, but rather the resources used in the webpage you show come from a insecure resource, i.e. not using HTTPS – Cheesebaron Jan 09 '18 at 08:57
  • Refer to https://stackoverflow.com/questions/11659324/remote-image-doesnt-get-displayed-in-html-page-displayed-in-uiwebview; https://forums.xamarin.com/discussion/90537/webview-does-not-load-css-and-images-on-ios , maybe helpful. – ColeX Jan 10 '18 at 09:01

1 Answers1

1

You should add as well the key referring to the content of the web views.

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

Anyway, I would suggest you include the specific domain you want to exclude from the ATS because unless you have a very good reason for it, Apple will reject your application in the review process.

Hichame Yessou
  • 2,658
  • 2
  • 18
  • 30