Cordova 5.3.1 and iOS9 platform - I cannot download images and scripts from external sources

First of all, I tried to connect via Socket.io, but soon realized that nothing from the outside could be loaded into my Cordova / iOS application. I checked the whitelist settings in the config.xml file. They seemed to be beautiful, but just in case I added

Unfortunately, this did not help. I tried to remove the whitelist plugin

cordova plugin add org.apache.cordova.whitelist

The plugin "cordova-plugin-whitelis" is not in the project. To see cordova plugin list.

So, I checked the list of cordova plugins and returned

cordova-plugin-console 1.0.1 "Console"
cordova-plugin-dialogs 1.1.1 "Notification"
cordova-plugin-vibration 1.2.0 "Vibration"
cordova-plugin-whitelist 1.1.0 "Whitelist"

I think the one above may be kind of standard?

My next attempt: remove the next meta tag from index.html

<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *">

But that didn't help either ...

+4
3

, , , , , , Info.plist ( - HelloWorld-Info.plist)

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

- !

, .

+5

iOS 9 , App Transport Security (ATS), https AJAX HTML5 , Cordova Ionic. , , NSAppTransportSecurity, . "cordova-plugin-disable-nsapptransportsecurity". , :

cordova add cordova-plugin-disable-nsapptransportsecurity

. : iOS9 ATS: HTML5?

: https://www.npmjs.com/package/cordova-plugin-disable-nsapptransportsecurity

whitelist, , , iOS. iOS.

+2

I was not sure that the image sources were connected with the http or https protocol. My images were from "http", which did not display correctly. After changing the source to https, he began to display images.

+1
source

Source: https://habr.com/ru/post/1608119/


All Articles