Reputation: 3048
Apologies if this was asked before.
I am having a rather simple issue, and I am wondering if i am missing something obvious. In my practice Xamarin.Forms app, I am having issue loading the following image source URI: http://lorempixel.com/1920/1080/sports/7/ even though when i go there via my browser; it is fine.
It seems to me like Xamarin needs an image extension for it to work, so for example if i were to have some sort of image online like (https://www.stickpng.com/assets/images/58b061138a4b5bbbc8492951.png , fair warning; this link will download the cat image if you go to it) then it loads up fine.
My question is two fold: Am I missing something simple in my configuration that I need to enable (this is for Android as I don't have an iOS device available atm), and B: Does xamarin even support relative paths?
Code Behind:
var source = new UriImageSource
{
Uri = new Uri("http://lorempixel.com/1920/1080/sports/7/")
};
source.CachingEnabled = false;
ImageOne.Source = source;
Upvotes: 0
Views: 182
Reputation: 15342
Both iOS & Android now require https
:
Apple will require HTTPS connections for iOS apps by the end of 2016
“Today, I’m proud to say that at the end of 2016, App Transport Security is becoming a requirement for App Store apps,” Apple’s head of security engineering and architecture, Ivan Krstic, said during a WWDC presentation
Android P Will Default to HTTPS Connections for All Apps
[Android P] will default to blocking HTTP traffic in apps by default
It should be an easy fix - change http
to https
:
var source = new UriImageSource
{
Uri = new Uri("https://lorempixel.com/1920/1080/sports/7/")
};
source.CachingEnabled = false;
ImageOne.Source = source;
Upvotes: 2