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

Respect the user addressbook label #42

Closed paintedbicycle closed 6 years ago

paintedbicycle commented 6 years ago

This PR allows the user to have any label they like (iOS allows for custom labels).

It also fixes a bug here if the user’s label contained a capital letter (i.e. "Home" instead of "home", this check did not correctly match the label.

Lastly if fixes a bug that completely erases the user's label if it did not match one of the preformatted options.

joshuapinter commented 6 years ago

Awesome!

Question: Does iOS save their iPhone labels as "iPhone" or "iphone"? And, looking at the code change, this accounts for both anyway, correct?

paintedbicycle commented 6 years ago

iPhone and iCloud are both capitalized.

This PR changes both the user input and the Apple strings to lowercase while checking only. The actual label itself is not transformed and capitals are maintained.

joshuapinter commented 6 years ago

Perfect. 👌