Reputation: 75296
I'm trying to learn about how to deal with the permissions/access requests in iOS 6. Everything I've found so far just kind of describes this vaguely without presenting any code samples etc. Are there any good resources/tutorials for this?
Specifically, I'm trying to discover whether there's a way to re-prompt the user programmatically to allow access to the address book etc. Or just general information on how to integrate this stuff into an app.
Upvotes: 1
Views: 1629
Reputation: 3541
Under Address Book in the iOS 6 SDK Release Notes, it says:
Users are able to grant or deny access to contact data on a per-app basis. To request access to contact data, call the ABAddressBookRequestAccessWithCompletion function after calling the ABAddressBookCreateWithOptions function. The ABAddressBookRequestAccessWithCompletion function does not block the app while the user is being asked to grant or deny access. Until access has been granted, the ABAddressBookRef object will not contain any contacts, and any attempt to modify contacts fails with a kABOperationNotPermittedByUserError error. The user is prompted only the first time access is requested; any subsequent calls to ABAddressBookCreateWithOptions will use the existing permissions. The completion handler is called on an arbitrary queue. If the ABAddressBookRef object is used throughout the app, then all usage must be dispatched to the same queue to use ABAddressBookRef in a thread-safe manner.
Although this is only speaking for the Address Book, I'm sure it applies to Photos, Contacts, etc.
Upvotes: 2