0

I get a list of urls of images (e.g., https://thisisanurl.png) from a let's say API/GetImageUrls. But those url images can't be viewed without a key authentification.

I was using FFImageLoading plugin to add a custom HttpClient to the ImageService for opening those urls and get the images behind it.

public App()
    {
        ImageService.Instance.Initialize(new Configuration
        {
            HttpClient = new HttpClient(new CustomHttpClientHandler()),
            VerboseLogging = true
        });

        InitializeComponent();
    }

...

public class CustomHttpClientHandler : HttpClientHandler
{

    protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    {
        request.Headers.Add("APIKey", AppSettings.ApiKey);
        return await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
    }

}

Now that FFImageLoading isn't supported anymore I need a new way of doing this. Any ideas?

Thanks

sesitosVDX
  • 41
  • 1
  • 7
  • what do you mean "FFImageLoading isn't supported anymore"? – Jason Jun 20 '22 at 14:07
  • 1
    FFImageLoading is still working but hasn't had any update for the last 3years and there are many reported bugs and crashes not being solved. – sesitosVDX Jun 20 '22 at 14:14
  • FF is open source, so you can always modify itself to suit your needs. Or you could use it as inspiration for creating your own ImageSource that handles authentication. – Jason Jun 20 '22 at 19:08

0 Answers0