AddressBook: How to Get the Names of Different Exchange Sources

I want to get the name of all the Exchange sources my iPhone is synchronized with. E.g. if I synchronize my device with Gmail and Hotmail accounts using ActiveSync Exchange, in my native contacts I can see different sections based on the different accounts that I have installed. When I try to do the same programmatically, the only information I get is sourceType (which is Exchange in both cases) and sourceName (which is "Contacts" in both cases). It’s not possible for me to distinguish between Gmail Contacts and Hotmail Contacts.

Does anyone know how to do this? Here is my code:

CFArrayRef allSources = ABAddressBookCopyArrayOfAllSources(book); for (CFIndex i = 0; i < CFArrayGetCount(allSources); i++) { ABRecordRef source = (ABRecordRef)CFArrayGetValueAtIndex(allSources, i); NSString *sourceTypeName = (NSString *)((CFStringRef)ABRecordCopyValue(source, kABSourceNameProperty)); NSLog(@"%@", sourceTypeName); } 
+4
source share
1 answer

You can't do it in iOS, it seems (for now)

0
source

Source: https://habr.com/ru/post/1347414/


All Articles