How to get the contacts in iPhone? I need to get all attributes from iPhone 开发者_如何学Gocontacts. How to achieve programmatically using MonoTouch?
ABAddressBook iPhoneAddressBook = new ABAddressBook();
ABPerson[] Contacts = iPhoneAddressBook.GetPeople();
foreach (ABPerson item in Contacts) {
ABMultiValue<NSDictionary> Contact = item.GetPhones();
foreach (ABMultiValueEntry<NSDictionary> cont in Contact) {
// cont.Label indicates the type ( home,work,etc)
// get the contact via cont.Value
}
}
Use ABAddressBook
精彩评论