I noticed that:
Image1.src = "https://....";
It works in the www app but not in the Android app.
Is that how it should be?
Is it possible to dynamically download images from the www in the Android and iOS app?
I noticed that:
Image1.src = "https://....";
It works in the www app but not in the Android app.
Is that how it should be?
Is it possible to dynamically download images from the www in the Android and iOS app?
Whenever something isn’t working on a device, the first thing to check is the remote console. There is probably a message there.
Check that to see what needs to be fixed.
There is this error in the console:
Refused to load the image 'https://aqi.pl/radio-republika.svg' because it violates the following Content Security Policy directive: "img-src 'self' data:".
Can this be fixed?
Yes. It’s a CORS error. There is more information in that same “Troubleshooting” link.
You need to add an extra line to your extraheaders property in Project Properties.
I added to extraheader:
<meta http-equiv="Content-Security-Policy" content="img-src 'self' https://aqi.pl data:;">
In the www application in the browser there is:
<meta http-equiv="Content-Security-Policy" content="img-src 'self' https://aqi.pl data:;">
and it’s OK,
but in the Android application the console shows:
<meta http-equiv="Content-Security-Policy" content="default-src * gap://ready file:; style-src 'self' 'unsafe-inline' *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; img-src 'self' data:;">
and how in the console I try execute:
i=$('#Image1_img')[0]
i.src="https://aqi.pl/radio-republika.svg"
This is still an error:
Refused to load the image 'https://aqi.pl/radio-republika.svg' because it violates the following Content Security Policy directive: "img-src 'self' data:".
Maybe it’s not allowed in the Android app?
Sorry, I gave you obsolete information. Rather than adding that line to extraheaders, it should be in contentSecurityPolicy.
Yes, thank you
Everything works
Remember, we are not pasting this:
<meta http-equiv="Content-Security-Policy" content="img-src 'self' aqi.pl data:;">
only this (content):
img-src 'self' aqi.pl data:;
Good point!