GroupMe Contacts | Address Book

I want to build a ContactsTableViewController like that of GroupMe. It shows all my Address Book contacts and even which ones are GroupMe users.

It seems that ABPeoplePickerNavigationController cannot be customized.

  1. So, if I access Address Book contacts with ABAddressBook & ABPerson, what's the best way to display them with a custom UITableViewController?

    I don't want to just load all Address Book contacts into an NSArray because that could kill the memory (I know people who have thousands of Address Book contacts on their phones.). I'm used to using Core Data & NSFetchedResultsController for large result sets like this. But, to do that, I'd have to create an ABPerson model in Core Data, which would be easy, but keeping it in sync with the Address Book seems challenging and sort of silly.

  2. What's the best way to relate/link GroupMe contacts to Address Book contacts?

  3. Is there anything else I should know/consider when trying to recreate this GroupMe-style interface?

Answers


I'm one of the GroupMe iOS developers and this is what we do.

  1. We scan the users address book and store it in Core Data. We have a Contact object that has a 1-to-many against phone numbers, and a 1-to-many against email addresses. The first scan can take a little time if there a lot of contacts, but in each subsequent scan we ignore any ABRecordRef that has a kABPersonModificationDateProperty before our last scan. This makes updates a lot faster.

  2. Then, assuming the user has opted into syncing contacts, we upload phone numbers and email addresses to our server which will match against existing GroupMe users.

  3. Finally, we pull GroupMe relationships based on matches (from phone, email, facebook, twitter) and store those in Core Data as well. If relationship was made because of a phone/email already existing in the user's address book, we pass those values back in the relationships so we can create a 1-to-1 relationship between the GroupMe relationship and the contact we stored in Core Data in step 1. This way we can easily create NSFetchRequests for local contacts, or GroupMe relationships and have their relationship details available at any point (so we can show that a local contact is a GroupMe user etc -- like Aaron G. in your screenshot)

We use a NSFetchedResultsController, as well, so we can get updates reflected in the UI if our background operations find any new contacts/relationships..

The only other tips are to make sure you have your fetch request prefetch all relationships so loading relationship reasons don't hit core data as you scroll to populate faults.

And yeah, while keeping your Core Data n'sync with the user's address book is more tedious than silly, it's worth it so you can have easy access to it and for queries that need to know all that jazz.


Need Your Help

Rails: How to run before_update only for one changed attribute?

ruby-on-rails ruby-on-rails-3 activerecord beforeupdate

In my model Shop I'm saving image url in logo_ori and use that to make thumbnails using before_update.

$_REQUEST not created when using variable variables?

php

Consider the following snippets of code:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.