2

I try to use the contacts list in my Xamarin.Form application. I use

Task<IEnumerable<Contact>> contact = await Xamarin.Essentials.Contacts.GetAllAsync(token);

but Contact doesn't contain a field with image. What can I use instead?

Thank you in advance.

  • 1
    Unfortunately, Xamarin.Essentials Contact class does not include photo. You would have to write code per platform, in each platform-specific project. For Android, [see this SO post](https://stackoverflow.com/a/43757530/199364). – ToolmakerSteve Nov 03 '21 at 03:53
  • I see. Thank you. – Nikita Burmistrov Nov 03 '21 at 08:17
  • 2
    You could use the dependency service to do the specific implementations. https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/dependency-service/introduction For Android, you could use the Contacts ContentProvider. https://github.com/MicrosoftDocs/xamarin-docs/blob/live/docs/android/platform/content-providers/contacts-contentprovider.md – Wendy Zang - MSFT Nov 03 '21 at 08:22

0 Answers0