How to get the contacts in iPhone? I need to get all attributes from iPhone contacts. How to achieve programmatically using MonoTouch?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Use ABAddressBook
回答2:
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
}
}