Recently I was doing an application that needs to access contacts at the iOS and Android.
I found those two pieces of code
But you need different unit for each platform and the names of fields are also little but different.
So I built from the one library that works the same at Android and iOS.
You can download them here .
1) call function createContactsManager from your code. It will return TContactsManager class. At windows nil is returned. Never use TContactsManager.create as it’s an abstract class.
2) From created object call function ExtractContactsList
3) Property ContactsCount will return number of contacts and each contact can be accessed via property Contacts[index].
For android you need to go to settings of the project and turn on access to the contacts:
At the iOS it’s even more simple. No need of special permission. The library contains a dialog that will ask user to grant permissions to read the contacts and if the user agree the application can read data.