Adding more text to NSContactsUsageDescription

  1. 4 years ago

    Beatrix W

    12 Dec 2015 Pre-Release Testers Europe (Germany)

    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.""")
  2. Tim P

    12 Dec 2015 Pre-Release Testers Rochester, NY
    Edited 4 years ago

    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?

  3. Beatrix W

    12 Dec 2015 Pre-Release Testers Europe (Germany)

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

  4. Sam R

    12 Dec 2015 Pre-Release Testers, Xojo Pro Hengchun, Pingtung, Taiwan

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

  5. 9 months ago

    Stanley R

    11 Oct 2018 Pre-Release Testers Europe

    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

  6. 8 months ago

    Horst J

    28 Nov 2018 Pre-Release Testers, Xojo Pro Europe, Germany, Stuttgart

    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)

  7. Sam R

    28 Nov 2018 Pre-Release Testers, Xojo Pro Hengchun, Pingtung, Taiwan

    Oh crap... I always forget about different languages.

or Sign Up to reply!