joshuapinter / react-native-unified-contacts

Your best friend when working with the latest and greatest Contacts Framework in iOS 9+ in React Native.
MIT License
158 stars 56 forks source link

Included contact phone numbers in the response object #1

Closed homanp closed 8 years ago

homanp commented 8 years ago

Hey,

Love the what you've done so I thought I'd contribute.

Thought it would be nice to include phone numbers in the Contact response object.

joshuapinter commented 8 years ago

Thanks @homanp! That'll take one more item off of the To-Do list.

Let me take a look at this and get back to you.

homanp commented 8 years ago

Cool @joshuapinter. Was also planning on implementing email addresses and social profiles. Incredible how easy this whole thing is with CNContact.

joshuapinter commented 8 years ago

They really did a great job with this Contacts rewrite. Feel free to do those additions as well, that would be great. I've been working on a Contact-UI package that allows you to easily search and select Contacts as well. It'll tie tightly into this package.

Let me know if you're gonna take a stab at the emails and socials as I'll work on other things.

homanp commented 8 years ago

Sure thing, I will definitely add emails this week. Will make a separate PR for that. Will look into social profiles as well, probably next week.

One cool feature would be searching by number. What do you think about that?

joshuapinter commented 8 years ago

Regarding Emails, awesome.

Searching by number is good. I wanted to expand searching in general, to include emails, etc. Do you think they should be separate methods or just integrated in the searchAllContacts method?

So you could just pass a string to searchAllContacts and it will search givenName, familyName, emails, phone numbers, etc.

homanp commented 8 years ago

I have to think about it but my initial thought is one search method for all keys in the dict. Perhaps add options to what fields should be searchable, e.g {"givenName", "familyName", "email"} in the React implementation.

I think Algolia does a fine job with their JS-client. Perhaps grab some inspiration from those guys.

https://github.com/algolia/algoliasearch-client-js

joshuapinter commented 8 years ago

I'm merging this in now. It'll be a little different than how you implemented it to stick with the other pieces so when you update your package, make sure to adjust your app code.

Also, I'll be doing the emails this weekend because I need it for a new app release so let me know where you got on that.

homanp commented 8 years ago

Ok! I'll pull the latest when you've merged. Haven't started emails yet. Spent a bunch of time figuring out the imagaData thing.

The principle of emails is basically the same as Phon numbers. Same goes for social profiles. Did some research on it this past week.

joshuapinter commented 8 years ago

Right on!

joshuapinter commented 8 years ago

Updated master and included a section in the README to show what is returned with the Contact objects:

https://github.com/joshuapinter/react-native-unified-contacts#contact-object