2

I have an app with a crash reporter that autofills in the user email address by getting it from ABAddressBook. I'm trying to get an informative message of intent in the dialog that 10.8 displays asking the user for permission. Following the advice at http://www.red-sweater.com/blog/2672/can-i-get-your-address , I've added the following to the app's Info.plist:

<key>NSContactsUsageDescription</key>
<string>blah blah blah</string>

Unfortunately, this is not working. The dialog still asks, but it does not display my description text. I've tried:

  • Putting this in the crash reporter framework's Info.plist instead of the app's.
  • Signing the app with my Developer ID cert.

But, alas, no luck. Anyone gotten this to work that can give me a tip as to what I'm doing wrong?

c-had
  • 1,380
  • 1
  • 9
  • 18

2 Answers2

2

[UPDATE] I found the real reason why restarting helps. It kills the tccd process, which looks like the culprit in charge of displaying the message on that dialog.

So, just open Activity Monitor and kill the tccd process and your new message should just show up next time the dialog shows.

[Old Answer] I was running into the same problem and wasn't really sure why (I was doing exactly what the documentation said to do). I finally got it working after:

  • Deleting the container my app was living in (~/Library/Containers/com.company-name.app-name)
  • Cleaning the build (In Xcode: Product -> Clean)
  • Restarting my machine (seems a little cargo-cultish, but I think this is what fixed the problem)
  • Building and running my app

The next time my app tried to access the Address Book API I was presented with the dialog that included my message.

I think Apple must be caching that message somewhere (either the message you want, or an empty string if you ran your code before you had a message to show), and the only way to clear it out is to restart. I tried the first 2 steps many times with no change in the message, even after I got the message working and then tried to change it.

siannopollo
  • 1,464
  • 11
  • 24
-1

Solution is to run this command in the Terminal:

tccutil reset AddressBook

Source: https://developer.apple.com/library/archive/qa/qa1906/_index.html

Cœur
  • 37,241
  • 25
  • 195
  • 267
Stan Busk
  • 53
  • 8