0

Using MonoTouch on IOS6, how do I get my address book contacts which were created in iPhone only (excluding contacts from other groups such as Facebook)?

I'm using the following code, however, it seems to return people from every group. The results would include contacts I've created as well as contacts synced from Facebook in IOS6.

ABAddressBook iPhoneAddressBook = ABAddressBook.Create(out err);
if(err != null)
    return null;

return iPhoneAddressBook.GetPeople();

I have tried doing the following, but the GetGroup function returns null.

return iPhoneAddressBook.GetPeople(iPhoneAddressBook.GetGroup(0).Source, ABPersonSortBy.FirstName);
  • if GetGroup() is returning null then you probably do not have any Groups defined. Are you testing in the simulator or on a device? – Jason Feb 23 '13 at 22:25
  • On the device with iOS6.1. The apple Phone app shows 2 groups, one iPhone Contacts another Facebook. – Jeffrey Lewis Feb 24 '13 at 01:23
  • does GetGroups() return a list of groups on the device? If it does not, and you're sure that you have groups, you should probably submit it as a bug to Xamarin. – Jason Feb 24 '13 at 02:04
  • I've submitted a bug report at https://bugzilla.xamarin.com. ID:10616 incase anyone else is having the same problem. – Jeffrey Lewis Feb 24 '13 at 07:24

0 Answers0