I'm developing an application using ionic, iOS, and Android, too. I have to load external images using ng-src
at url:
http://test.url.eu:1337/fileuploads/receive/552f6d1786a3ea3772000004
It works fine on iOS, but on android I have unsafe error and the image is not loaded. How can I can fix this?
EDIT: It works on android 4.4 and 5 but not for < 4.4. I'm using crosswolk.. thankyou
I had a similar problem where the app worked great on PC but 404's on android. Depending on your Cordova version, as seen at Cordova Android 4.0.0 announcement, since Cordova 4.0.0 it could be you must add the cordoba-
To install:
Cordova plugin add https://github.com/apache/cordova-plugin-whitelist.git
.After this you'll need to add the mandatory content security policy: (a simple one to try out is:
<meta http-equiv="Content-Security-Policy" content="default-src *; img-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'">
but i would recommend reading about the options at http://content-security-policy.com). Don't forget to check your config.xml for defining access origin (simplest is<access origin="*"/>
). If still does not work have a look at https://github.com/apache/cordova-plugin-whitelist#navigation-whitelist to see if you require navigation or intent white-listing. Good luck!