Primarily I was trying to get connection through Socket.io but soon figured out that nothing from "outside" can be loaded into my Cordova/iOS app. I checked the whitelist settings in config.xml. They seemed to be fine but just in case I added
Unfortunately that didn't help. I tried to remove the whitelist plugin
cordova plugin add org.apache.cordova.whitelist
Plugin "cordova-plugin-whitelis" is not present in the project. See
cordova plugin list
.
So I checked cordova plugin list and that 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 guess the one above may be some sort of default one?
My next try was removing the following 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...
After many hours of struggling with the Cordova settings I'm still unsure what Whitelist I have installed and what is the best way of setting it up
but one thing that certainly helped me was inserting into Info.plist
(may be something like HelloWorld-Info.plist
)
the following tags
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
After that I can connect through web-socket or load external images!
I hope this will help some time the others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With