Xamarin.Forms.Contacts
Xamarin.Forms.Contacts copied to clipboard
How to load the PhotoUri ?
For instance, on Android that I am testing now, I got the result content://com.android.contacts/contacts/120
How to show this image ?
For instance, on Android that I am testing now, I got the result content://com.android.contacts/contacts/120
How to show this image ?
did u resolve it? because I need help too.
No, I didn´t !
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Livre de vírus. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail. <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Em ter, 20 de nov de 2018 às 16:51, Andy [email protected] escreveu:
For instance, on Android that I am testing now, I got the result content://com.android.contacts/contacts/120
How to show this image ?
did u resolve it? because I need help too.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/enisn/Xamarin.Forms.Contacts/issues/9#issuecomment-440388832, or mute the thread https://github.com/notifications/unsubscribe-auth/AQiRLIaRihcxbbnn_Qb5_E9Gl3EXIpjMks5uxE8YgaJpZM4XKhWr .
--
Atenciosamente,
Marcelo Couto Fernandes Desenvolvedor Mobile iOS, Android e WinPhone
Photo uri is empty
Update: In Android I can get photo uri, but in iOS It is empty.
Looks like on iOS it uses CNContact which doesn't contain PhotoUri. CNContact has ThumbnailImageData and ImageData which are raw data. Here: https://github.com/enisn/Xamarin.Forms.Contacts/blob/master/Plugin/ContactService/Shared/Contact.cs We may need to add other properties in Contact class to store raw data for iOS. https://github.com/enisn/Xamarin.Forms.Contacts/blob/master/Plugin/ContactService/Platforms/iOS/ContactServiceImplementation.cs Also read these raw data from CNContact object and add it into Contact object.
I think the answer @marcelocferdeveloper and @andyvasilevich are looking for is:
var u = Android.Net.Uri.Parse(uri); // e.g. content://com.android.contacts/contacts/120
img.Source = ImageSource.FromStream(() => Android.App.Application.Context.ContentResolver.OpenInputStream(u));
I'm still working on iOS, but I appreciate @gaocan1992 's last comment