CORS problem in Android device
Hi, I am trying to use this plugin to download and cache some images (each and every image is showned every second, as a forecast map). In my web browser Chrome works perfectly, but when I install the app on a real android device I could see trought logcat I am getting CORS blocking
Access to XMLHttpRequest at '<MY_URL_TO_THE_IMAGE>' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Some help? Thanks
I experience a similar problem. It seems like the ionic 4 compatible version displays the image but isn't capable of storing them in the cache. Some devs mentioned that the IonicWebView has problems since 4.2.1 and blocks CORS.
Hello, I'm facing the same problem... Did you solve it?
As far as I know the only solution might be the following: Own the server you receive the data from and set up ACAO for whatever you need. https://enable-cors.org/ That's at least how I solved this.
uff, it is a so big limit, because it isn't my server where are stored the images...
am using aws s3 bucket it worked on ios perfectly now but on android i dont receive any errors but the images never shown please if its a cors thing can u change the code to use ionicnative http and ditch the angular http since ionic native provide a proxy which solves this problem
I'm using AWS S3 bucket and was facing the same CORS problem when I updated the ionic cordova webview to V2+. To solve this, just configure the CORS in the Amazon console like this:
https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html
@pcsantana I'm using my own server, what should I do? It's two days that I'm searching but didn't make it yet. I think the plugin needs some debugging on ionic4
Hi @khsed14 sorry for delay!
I did not tried yet this plugin with ionic 4, but you should implement a CORS filter in your backend. (e.g. in Java).
Also, ionic team makes some considerations here.
This plugin has too a branch for Ionic v4. You can try to use it: https://github.com/zyra/ionic-image-loader/tree/v4
Holpe it helps!
iam facing the similar issue on device but also facing CORS issue with firebase ? any solutions
I‘m facing this issue with iOS and CloudFront in combination with S3... I configured CORS on S3 and forward the Headers in CloudFront.
Anyone else having this problem or did solve it?
EDIT: Seems to be my own fault. As described on #277 the cache cleaning is not working for me so I deleted the folders manually. This seems to break down the plugin and causes CORS issues. If I reinstall the App, everything is working fine again til I delete the folders again :)