0

I want to show an image from http site in Xamarin.Forms. I have tried the following code.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

             x:Class="App_ImageUrl.MainPage">

    <StackLayout VerticalOptions="Center" HorizontalOptions="Center">
        <Image Source="http://45.159.114.25:88/Uploads/Sale/SkuImage/10_9c0d07a145d1418c840c284fbca9614f.jpg" VerticalOptions="Center" HorizontalOptions="Center" Aspect="AspectFill" x:Name="nn" />

        <Image Source="https://dkstatics-public.digikala.com/digikala-products/199716.jpg?x-oss-process=image/resize,m_lfit,h_350,w_350/quality,q_60" BackgroundColor="Red" />

    </StackLayout>

</ContentPage>

First image does not show, but the second image shows.

Both images are available on the Internet. What is the difference?

Cheesebaron
  • 24,131
  • 15
  • 66
  • 118
  • 1
    Use `https` (or you will have to setup your app to use the untrusted website) – SushiHangover Sep 05 '20 at 02:14
  • 2
    Does this answer your question? [Android 8: Cleartext HTTP traffic not permitted](https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted) – Tuğçe Arar Sep 05 '20 at 11:53

1 Answers1

0

As @SushiHangover said one is travelling over HTTP and the other one over HTTPS, iOS and Android have implemented security mesures so you'd need special set ups to be able to make a request to a site without a security certificate.