abaddressbook

Swift - Checking unmanaged address book single value property for nil

拈花ヽ惹草 提交于 2019-11-26 22:25:32
问题 I'm relative new to iOS-Development and swift. But up to this point I was always able to help myself by some research on stackoverflow and several documentations and tutorials. However, there is a problem I couldn't find any solution yet. I want to get some data from the users addressbook (for example the single value property kABPersonFirstNameProperty ). Because the .takeRetainedValue() function throws an error if this contact doesn't have a firstName value in the addressbook, I need to

Toggling Privacy settings will kill the app

假装没事ソ 提交于 2019-11-26 20:00:54
I have an app that uses the iPhone's contacts. With iOS 6, the user will be prompted for Contact access on the first try. At this point, the user can hit 'Allow' or 'Don't Allow'. The problem is when the user backgrounds the app, and then navigates to Settings->Privacy->Contacts to toggle the Contact privacy setting for my app. Once it is toggled, I can see on the console that my app: Application 'UIKitApplication:com.myApp' exited abnormally with signal 9: Killed: 9 I can't find any information on this in Apple's documentation. Does anyone know a way to prevent this? Is this as designed? Or

How do I correctly use ABAddressBookCreateWithOptions method in iOS 6?

江枫思渺然 提交于 2019-11-26 19:06:36
问题 I am trying to understand the ABAdressBookCreateWithOptions and ABAddressBookRequestAccessWithCompletion methods in iOS 6. The most information i have been able to find is the following, "To request access to contact data, call the ABAddressBookRequestAccessWithCompletion function after calling the ABAddressBookCreateWithOptions function." I believe together these methods should alert the user to decide whether to allow the application access to contacts, however when I use them I am seeing

iOS 6 Address Book not working?

大兔子大兔子 提交于 2019-11-26 18:12:34
问题 My method of programmatically retrieving e-mail addresses from the Address Book no longer seems to work on iOS 6 devices. It worked in iOS 5 and oddly, still works in the iOS 6 Simulator. Is there a new way to programmatically retrieve contacts from a users' Address Book? ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook); CFIndex nPeople = ABAddressBookGetPersonCount(addressBook); self.contacts = [[NSMutableArray alloc]

Accessing iOS Address Book with Swift: array count of zero

孤者浪人 提交于 2019-11-26 18:01:07
问题 I am trying to write a simple method to ask a user for access to their address book and then print out the name of each person in the address book. I've seen a number of tutorials explaining how to do this in objective-C, but am having a hard time converting them to swift. Here's what I've done so far. The below block runs in my viewDidLoad() method and checks to see whether the user has authorized access to the address book or not, if they have not authorized access yet, the first if

Detect what was changed from ABAddressBookRegisterExternalChangeCallback

这一生的挚爱 提交于 2019-11-26 17:44:28
问题 I am using ABAddressBookRegisterExternalChangeCallback to get the external changes in AddressbookBook of the user. I am using the following code to register the callback: ABAddressBookRef ntificationaddressbook = ABAddressBookCreate(); ABAddressBookRegisterExternalChangeCallback(ntificationaddressbook, MyAddressBookExternalChangeCallback, self); and when this callback is called then MyAddressBookExternalChangeCallback is called successfully void MyAddressBookExternalChangeCallback

ABAddressBook ABSource and ABSourceType

Deadly 提交于 2019-11-26 16:18:46
问题 I am attempting to create an app that can be used to search an Exchange GAL, however, I am finding the new 4.0 documentation regarding this subject confusing. Does anyone know how I might go about searching the GAL for names containing a specific string (e.g. "Smi")? My source code at the moment is all but useless as I am simply trying to wrap my head around how to specify that I am wanting only to search the GAL and not the local contacts on the device. Also, how is

App crashed in iOS 6 when user changes Contacts access permissions

夙愿已清 提交于 2019-11-26 14:31:49
I have an app that uses the Address Book. When running in iOS 6 it runs this code when the user does something that requires Address Book access. if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) { ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL); ABAddressBookRequestAccessWithCompletion(addressBookRef, ^(bool granted, CFErrorRef error) { if (granted) { showContactChooser(); } }); CFRelease(addressBookRef); } else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized) { showContactChooser(); } else {

How does Square's CardCase app automatically populate the user's details from the address book?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 12:37:08
问题 Square\'s new card case iOS app has a \"Create Account\" feature. Tap it and it shows a form PREPOPULATED with the user\'s entry from the Address book. How is this possible? Anyone know? I thought this was unpossible, to get the user\'s info this way. It\'s not an iOS 5.0 thing, afaict. 回答1: the only solution I could come up with was using the device name and then searching the addressbook for a match. this assumes someone would use a particular naming convention. I for example use 'Nik's

Obtaining Specific ABSource from ABAddressBook in iOS 4+

一个人想着一个人 提交于 2019-11-26 09:46:22
问题 Does anyone have an example of how to obtain a specific ABSource from the ABAddressBook in iOS 4+? 回答1: iOS 4+ provides new API that allows one to select a specific ABSource from the ABAddressBook. This may be useful as some operations, e.g. creating an ABGroup, are not supported in some sources (i.e. Exchange). "Not all source types support groups, more conspicuously, Exchange does not know anything about groups." - http://flavors.me/volonbolon#1a5/tumblr Attached are functions that leverage