private async Task <AddressBookSearchArgs> GetContactByIdAsync(string id) { var contacts = await WinRtContactManager.RequestStoreAsync(); var result = await contacts.GetContactAsync(id); return(WrapContacts(result)); }
public async Task <AddressBookSearchArgs> GetContactByPhoneNumberAsync(string number) { var contacts = await WinRtContactManager.RequestStoreAsync(); // ISSUE: On 8.1 we cannot search by phone number, only by all fields in the contact. // on 10 we should use GetContactReader to specify a phone number match // number = new string(number.Where(c => Char.IsDigit(c)).ToArray()); IEnumerable <WinRtContact> result = await contacts.FindContactsAsync(number); return(WrapContacts(result)); }
public async Task <AddressBookSearchArgs> GetAllContactsAsync() { var contacts = await WinRtContactManager.RequestStoreAsync(); if (contacts == null) { Debug.WriteLine("contacts-ContactsManager returned null!"); return(ErrorResult()); } var result = await contacts.FindContactsAsync(); if (result == null) { Debug.WriteLine("contacts-FindContactsAsync returned null!"); return(ErrorResult()); } return(WrapContacts(result)); }