Adding more text to NSContactsUsageDescription

How do I add text with spaces to NSContactsUsageDescription? When accessing the contact information from the user I want to inform him/her that only the me card is going to be accessed.

Doing one word is okay. Longer text with spaces is written to the plist file, which I verified with XCode. But it isn’t shown when accessing the contacts.

Does anyone have an idea how to use this correctly?

Mac OS 10.10, Xojo 2015r2.

Dim AppPath As String = CurrentBuildLocation + "/""" + CurrentBuildAppName + ".app""" Call DoShellCommand("/usr/bin/defaults write " + AppPath + "/Contents/Info ""NSContactsUsageDescription"" ""Only your yame and your email Address will be accessed.""")

What does the actual plist come out like? How does it compare to an info.plist that you can confirm works?
Also, have you tried using plutil instead of defaults?

Hmm… trying now with PlistBuddy, which seems to work. But it also could be caching issues.

If you have App Wrapper, you can specify this on the “Info” pane.

On this page: https://developer.apple.com/library/archive/qa/qa1906/_index.html

I found the solution, you have to run this command in the Terminal:

tccutil reset AddressBook

If you have multiple languages in your app, you can use this as build script:

Dim appName As String = CurrentBuildAppName
appName = ReplaceAll(appName, " ", "\ ") // Escape spaces for the command line

Dim appPath As String = CurrentBuildLocation + “/” + appName + “.app”

// German Access info for Contacts, Calendar, Reminder
command = “/bin/echo 'NSContactsUsageDescription = ““Der Zugriff auf die Kontakte benötigt””; '>>” + appPath + “/Contents/Resources/de.lproj/InfoPlist.strings”
Call DoShellCommand(command)
command = “/bin/echo 'NSCalendarsUsageDescription = ““Der Zugriff auf den Kalender benötigt””; '>>” + appPath + “/Contents/Resources/de.lproj/InfoPlist.strings”
Call DoShellCommand(command)
command = “/bin/echo 'NSRemindersUsageDescription = ““Der Zugriff auf die Erinnerungen benötigt””; '>>” + appPath + “/Contents/Resources/de.lproj/InfoPlist.strings”
Call DoShellCommand(command)

// English Access info Contacts, Calendar, Reminder
command = “/bin/echo 'NSContactsUsageDescription = ““Access to contacts is needed””; '>>” + appPath + “/Contents/Resources/en.lproj/InfoPlist.strings”
Call DoShellCommand(command)
command = “/bin/echo 'NSCalendarUsageDescription = ““Access to calendar is needed””; '>>” + appPath + “/Contents/Resources/en.lproj/InfoPlist.strings”
Call DoShellCommand(command)
command = “/bin/echo 'NSReminderUsageDescription = ““Access to reminder is needed””; '>>” + appPath + “/Contents/Resources/en.lproj/InfoPlist.strings”
Call DoShellCommand(command)

Oh crap… I always forget about different languages.