How do I read the contact list in the iPhone phonebook using Xamarin?
I need to read the contacts list from the iPhone calendar. I do not know how to do it and I did not find material in Portuguese about it. Can anyone help me with this?
How do I read the contact list in the iPhone phonebook using Xamarin?
I need to read the contacts list from the iPhone calendar. I do not know how to do it and I did not find material in Portuguese about it. Can anyone help me with this?
using(var addressBook = new ABAddressBook ()){ … }
var people = addressBook.GetPeopleWithName ("John Doe");
people.ToList ().ForEach (
p => Console.WriteLine ("{0} {1} - ", p.FirstName, p.LastName));
Along with GetPeopleWithName, ABAddressBook we have the GetPeople method. Using Linq, the result can be filtered based on some criteria, as shown:
var people = addressBook.GetPeople ();
people.ToList ().FindAll (p => p.LastName == "Smith").ForEach (
p => Console.WriteLine ("{0} {1}", p.FirstName, p.LastName));
Source: link