locked
Retrieve contact from its ID

    Question

  • It is possible retrieve a contact (instance of Contact class) from contact ID's?

    I would serialize a contact ID and when I deserialize, search contact from its ID. Then obtain its Thumbnail.

    I am using this code:

    ContactStore contactStore = await ContactManager.RequestStoreAsync();
    Contact contact = await contactStore.GetContactAsync(id);

    But don't work on Windows 8.1...


    CP http://www.fjmsoftware.altervista.org

    Saturday, June 28, 2014 9:52 AM

Answers

  • ContactStore api only available for Windows Phone. Windows doesn't have a build-in address book (the people app is just another app). So you need to use ContactPicker to let the user select a contact or use a COntactCard but you don't have direct access

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#


    Monday, June 30, 2014 5:28 AM

All replies

  • Hi,

     You can uses FindContactByRemoteIdAsync to retrieve a contact using its remote ID. You can also call FindContactByIdAsync to retrieve a contact by local ID. Some codes below:

    ContactStore conStore = await ContactStore.CreateOrOpenAsync();
    
        StoredContact   storCon = await conStore.FindContactByIdAsync(id);
    

    Please see the link below to get more information:

    http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn631244.aspx

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Monday, June 30, 2014 2:44 AM
  • ContactStore api only available for Windows Phone. Windows doesn't have a build-in address book (the people app is just another app). So you need to use ContactPicker to let the user select a contact or use a COntactCard but you don't have direct access

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#


    Monday, June 30, 2014 5:28 AM
  • @Anne Jing: Unfortunately, the ContactStore class not exists for Windows 8.1



    CP http://www.fjmsoftware.altervista.org

    Monday, June 30, 2014 7:27 AM
  • Hi,

    Sorry for that. Just like Dave says, ContactStore api only available for Windows Phone. You can try to refer to the Dave's suggestion.

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Thursday, July 03, 2014 7:35 AM