jamesmontemagno / ImageCirclePlugin

Circle Images for your Xamarin.Forms Applications
MIT License
239 stars 68 forks source link

Image not loading from URI on Android if image is provided on redirect #8

Closed locolab closed 8 years ago

locolab commented 8 years ago

Bug

When an image URI is given that has a redirect, the image does not load. Previous versions (before 1.6.1 and 1.6.1.beta were working fine with these links). iOS is able to load the images, but not Android.

Version Number of Plugin: 1.6.1 Device Tested On: Android Samsung Galaxy Tab 2 - Api 21 Tested Debug and Release mode Simulator Tested On: None (tested on other hardware devices though)

Expected Behavior

Expecting the image to load. When a link is given that is not a redirect, the image loads fine.

Problem is that we have blob storage where the actual images are, and to get there the redirect is needed to direct a request for a picture based on an Id. So the direct photo link is only accessible through a URL+ valid business Id or user Id. The web page then redirects to the blob storage link where the image resides.

Actual Behavior

Image does not load on Android, only on iOS.

Steps to reproduce the Behavior

Set Source URI to: https://system-dev.anyopp.com/api/public/picture/business/46968299-1f91-452d-94fa-691a4043b6af ^This is a redirect link. The API takes the given business Id and then redirects to the blob storage where the image is. Observe the image does not load.

Now set it to the direct link of the blob storage image that the above link loads to. https://anyoppblobsdev.blob.core.windows.net/public/7587ea70-d811-4398-af76-7e89453978c3

Observe the image loads fine.

locolab commented 8 years ago

Note: the plugin is rendering the border and size properly, just not the internal image.

locolab commented 8 years ago

It seems that WebImage from Xlabs has the same behavior. I've been having a lot of issues with Android related to HTTPS because our server is CloudFlare with TLS1.2 which has problems with Mono right now. Is there another way to use ModernHttpClient for the UriImageSource part?

jamesmontemagno commented 8 years ago

Nothing has changed in the plugin here for android in a long time, so it must just be something else. For TLS I would look into: https://developer.xamarin.com/guides/cross-platform/transport-layer-security/

Will close for now as it is not related to the control.

locolab commented 8 years ago

For anyone else that runs into this issue, you'll have to write your own Renderer for UriImageSource that uses a different implementation of HttpClient (one that doesn't have issues with TLS1.2), as per this link. https://forums.xamarin.com/discussion/40531/uriimagesource-and-authentication-headers

Thanks James.