abaddressbook

Grant access to NAB programatically on iOS 7.0 Simulator

允我心安 提交于 2019-11-29 15:11:43
问题 Is it possible to grant access to the native address book (NAB) on iOS 7.0 Simulator programmatically? I am writing xctest Unit Tests that need write access to NAB. The unit tests are run on iOS 7.0 Simulator and are part of Continuous Integration process and doesn't involve any user interaction. Currently unless the user grants access explicitly via the “TestApp” Would like to Access Your Contacts alert, access to NAB is denied. 回答1: In the spirit of sharing I am going to answer my own

How to ask for permission to access iphone contacts addressbook again?

不羁的心 提交于 2019-11-29 14:17:29
I am asking permission to access my contacts using the code below. ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { } else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized) { } else { } So far everything is working but however if I delete the app and debug again the app wont ask me the permission again. Prior to if I accepted or declined I can see it in privacy

Get iOS contact image with ABPersonCopyImageData

帅比萌擦擦* 提交于 2019-11-29 12:07:44
I'm trying to read the contact image of my iOS addressbook but I'm having some troubles with it. I have a method that read the information of contacts of ABAddressBookRef and put it on a struct. func readContacts(addressBook: ABAddressBookRef){ let allPeople = ABAddressBookCopyArrayOfAllPeople(addressBookRef).takeRetainedValue() as NSArray var numeros : [Numeros] = [] //lendo todos os contatos for person: ABRecordRef in allPeople{ let firstName = ABRecordCopyValue(person, kABPersonFirstNameProperty).takeRetainedValue() as! String let lastName = ABRecordCopyValue(person,

App “failed to resume in time” and hangs

♀尐吖头ヾ 提交于 2019-11-28 22:05:36
My app runs fine on my ipad but when I run it on my bosses ipad it hangs and stores the following device log, any ideas? Incident Identifier: 6C33511B-7C9A-474C-B888-84A4FAFF6F91 CrashReporter Key: 93bbba4f690eb1b7638fa7a09a3ff3aa4e6872f4 Hardware Model: iPad2,1 Process: Designer [5279] Path: /var/mobile/Applications/7AA5BF4A-007D-47F8-B1C5-30667477AA12/Designer.app/Designer Identifier: Designer Version: ??? (???) Code Type: ARM (Native) Parent Process: launchd [1] Date/Time: 2011-10-19 13:29:29.907 +0100 OS Version: iPhone OS 5.0 (9A334) Report Version: 104 Exception Type: 00000020 Exception

Search By Number and Get the image using ABAddressBook

二次信任 提交于 2019-11-28 21:39:54
问题 I wish to search in the iphone AddressBook through my app using the number as the key and then retrieve the image associated to that contact and display it on the UIImageView. I tried using ABAddressBook framework but was clueless to proceed. Can anyone please suggest me the solutions or any alternative path that I can follow. Any code snippet would also be of great help!! Any form of help would be highly appreciable. Thanks in advance 回答1: The AB framework can be a real pain at times. But it

Get iPhone phone number label from Address Book

北战南征 提交于 2019-11-28 18:51:53
So I have a method to get all the contact phone numbers from the address book on the iPhone, but is there a way to get the phone number label? For example you can do this: And I'd be looking to modify my method to print out the label (such as iPhone/Home/mobile/etc). ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef all = ABAddressBookCopyArrayOfAllPeople(addressBook); CFIndex n = ABAddressBookGetPersonCount(addressBook); for( int i = 0 ; i < n ; i++ ) { ABRecordRef ref = CFArrayGetValueAtIndex(all, i); NSString *firstName = (NSString *)ABRecordCopyValue(ref,

Dealing with duplicate contacts due to linked cards in iOS' Address Book API

为君一笑 提交于 2019-11-28 15:43:57
Some beta-users of my upcoming app are reporting that the list of contacts contain a lot of duplicate records. I'm using the result from ABAddressBookCopyArrayOfAllPeople as the data source for my customized table view of contacts, and it baffles me that the results are different from the iPhone's 'Contacts' app. When looking more closely at the Contacts app, it seems that the duplicates originate from entries with "Linked Cards". The screenshots below have been obfuscated a bit, but as you see in my app on the far right, "Celine" shows up twice, while in the Contacts app on the left there's

How to ask for permission to access iphone contacts addressbook again?

爱⌒轻易说出口 提交于 2019-11-28 08:06:14
问题 I am asking permission to access my contacts using the code below. ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { } else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized) { } else { } So far everything is working but however if I delete the app and debug again

Get iOS contact image with ABPersonCopyImageData

半城伤御伤魂 提交于 2019-11-28 05:55:51
问题 I'm trying to read the contact image of my iOS addressbook but I'm having some troubles with it. I have a method that read the information of contacts of ABAddressBookRef and put it on a struct. func readContacts(addressBook: ABAddressBookRef){ let allPeople = ABAddressBookCopyArrayOfAllPeople(addressBookRef).takeRetainedValue() as NSArray var numeros : [Numeros] = [] //lendo todos os contatos for person: ABRecordRef in allPeople{ let firstName = ABRecordCopyValue(person,

How to get iPhone contacts in iPhone application

人走茶凉 提交于 2019-11-28 02:16:48
问题 I want to get all the iPhone contacts in my iphone application.Is it possible?If so how?Anybody please help me. 回答1: Apple has a programming guide for the address book framework: Address Book Programming Guide for iOS Reference: http://www.iphonedevsdk.com/forum/iphone-sdk-development/61920-losing-imagedata-contact-when-adding-array.html ABAddressBook store values in NSDictionary http://iappdevs.blog.co.in/tag/how-to-get-contact-details-from-iphone-address-book-to-iphone-sdk/ iPhone Address