B4i Library [class] Contacts Library

Hi,

Please see attached a wrapper for ABAddressBook to access iOS contacts.
I will create a tutorial a bit later but it is very easy. Please see the attached project.
You can access contacts and also create a new contact.
There is a little bug when authorizing first time, the app is not continuing after first authorization.

Please let me know your thoughts

Narek
 

Attachments

  • ContactsLib.zip
    6.9 KB · Views: 102

Albi

Active Member
Licensed User
Longtime User
This is very cool!

Do you know why the authorisation doesn't work the first time?
 

Albi

Active Member
Licensed User
Longtime User
thank you kindly.

Do you also know if there is a way to get the sorting type that the user has in their phonebook (ie sort_by_firstname, or sort_by_lastname)?
do I just run GetAllContacts instead of GetAllContacts2 or GetAllContacts3? (I tried that and it returned an apparently random order!)
 

Albi

Active Member
Licensed User
Longtime User
sorry, i meant how to get the users preference for sorting, based on their iPhone settings and use that instead of setting it when initialising.
I should have googled it first!
I just changed the mContacts file, in a GetAllContacts function, to have
B4X:
ABPersonGetSortOrdering()
instead of
B4X:
kABPersonSortByFirstName
and it works.
 

palmzac

Active Member
Licensed User
Longtime User
Hi,

How to handle the categories in this library ? ( e.g. Add/Delete/Change Categories ) Would you help me ? Thanks !
 
Top