Ok so I'm trying to load images from external resources. My web api returns a json to my Nativescript app.
In my Nativescript code, I parse a json retrieved from my api, to construct the view manually. Everything works fine but the image part.
For the image, I proceed this way:
var image = new imageModule.Image()
image.src = page.bindingContext.news.getItem(args.index).image_original_link
then I attach it to my layout, through addChild.
I also tried to do it through an XML template, and I have the same problem:
<Image src="https://www.google.com/images/errors/logo_sm_2.png" stretch="none" />
this --^ is never rendered.
If I replace the url by an image located in my local directory:
image.src = "~/images/foo.png"
Then it works perfectly.
I tried to replace the dynamic source url fetched from my array by a static link to an image and it's not getting accessed (I checked the log on the webserver serving said image).
What am I doing wrong?
edit:
- I'm testing on iOS
I already have the following in my plist:
NSAppTransportSecurity NSAllowsArbitraryLoads