3

I'm writing an app that relies heavily on access to the iPhone address book. In iOS 6.0 users are now asked when the app first requests address book info whether they'd like to grant the app access to their contacts. It occurs to me that a user could select No without thinking the request through and thus render the app redundant.

I'd like to know if there's a way I can firstly tell that the app has been blocked and secondly (and in that case) re-request access to the device contacts.

4

1 回答 1

4

literally right at the top under address book:

https://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/_index.html

TL;DR:

The user is prompted only the first time access is requested; any subsequent calls to ABAddressBookCreateWithOptions will use the existing permissions.

An app can use the authorization status API to check if it can access contacts, calendars, reminders, or the photo library.

For Address Book, call the ABAddressBookGetAuthorizationStatus function

So no you can't re-request. The user has to navigate to settings and then privacy and toggle on for your app. You can tell if they denied you, though, so you can present a clear set of instructions within your app on how to turn it back on.

于 2012-10-02T12:15:06.523 回答