1

I am using the ContactPicker.PickContactAsync() api in a Windows 10 UWP (C#/XAML) project. I have tried using both my own code, and the sample project from the Windows 10 samples github repo, both have the same symtpom. The same symptom also occurs on both desktop and mobile OS', though it is primarily mobile I am interested in at this point.

When I call the PickContactAync method the system picker UI is shown as expected. I scroll through my contacts and pick one that is showing a profile image within the picker (it doesn't seem to matter which contact I pick, they all behave the same way).

The contact object return contains valid details (i.e the contacts name, email addresses etc) but SourceDisplayPicture, LargeDisplayPicture, SmallDisplayPicture and Thumbnail properties are all null. I cannot find any way to obtain the profile image(s) for a contact, even though I specifically picked a contact that dispalyed an image in the picker UI.

Does anyone know how to get the profile image?

Yort
  • 787
  • 8
  • 22
  • 1
    It's the same for me... the thumbnails are always null, although there is an image in the picker popup. But it seems that we are not the only two with the problem: https://social.msdn.microsoft.com/Forums/expression/en-US/3aba81b1-5f87-4bc4-98a2-8c291bd1502d/missing-thumbnail-contact-on-desktop-uwp?forum=wpdevelop . It would be interesting to set it from code and then trying to read it back... – gregkalapos Oct 28 '15 at 21:32

1 Answers1

2

The following code may help you:

ContactPicker cp = new ContactPicker();
Contact res = await cp.PickContactAsync();
ContactStore contactStore = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AllContactsReadOnly);
Contact realContact = await contactStore.GetContactAsync(res.Id);
Pang
  • 9,564
  • 146
  • 81
  • 122
kaa
  • 36
  • 2
  • This does work, *if* you add the 'contacts' capability to the app manifest, which is an unfortunate requirement and should be unneccesary. However, this is the only solution I know of, so thanks! – Yort Jan 02 '16 at 07:57