Friday, 14 October 2016

Privacy-Sensitive Data Permission

Privacy-Sensitive Data Permission



Open the file in your project named info.plist, right click it, opening as Source Code, paste this code below to it. Or you can open info.plist as Property List by default, click the add button, Xcode will give you the suggest completions while typing Privacy - with the help of keyboard ⬆️ and ⬇️.
Remember to write your description why you ask for this authorization, between <string> and </string>:


<!-- πŸ–Ό Photo Library -->
<key>NSPhotoLibraryUsageDescription</key>
<string></string>

<!-- πŸ“· Camera -->
<key>NSCameraUsageDescription</key>
<string></string>

<!-- 🎀 Microphone -->
<key>NSMicrophoneUsageDescription</key>
<string></string>
<!-- πŸ“ Location -->
<key>NSLocationUsageDescription</key>
<string></string>

<!-- πŸ“ Location When In Use -->
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>

<!-- πŸ“ Location Always -->
<key>NSLocationAlwaysUsageDescription</key>
<string></string>
<!-- πŸ’Š Health Update -->
<key>NSHealthUpdateUsageDescription</key>
<string></string>

<!-- πŸ’Š Health Share -->
<key>NSHealthShareUsageDescription</key>
<string></string>

<!-- α›’πŸ”΅ Bluetooth Peripheral -->
<key>NSBluetoothPeripheralUsageDescription</key>
<string></string>
<!-- 🎡 Media Library -->
<key>NSAppleMusicUsageDescription</key>
<string></string>
If it does not works, try to ask for the the background authorization:

<key>UIBackgroundModes</key>
<array>
    <!-- something you should use in background -->
    <string>location</string>
</array>

Or go to target -> Capabilities -> Background Modes -> open the background Modes:
enter image description here
then clean your Project, run it.

Here’s a mapping of each of the values in case you need to manually add them to the Info.plist:
  • Bluetooth Sharing – NSBluetoothPeripheralUsageDescription
  • Calendar – NSCalendarsUsageDescription
  • CallKit – NSVoIPUsageDescription
  • Camera – NSCameraUsageDescription
  • Contacts – NSContactsUsageDescription
  • Health – NSHealthShareUsageDescription & NSHealthUpdateUsageDescription
  • HomeKit – NSHomeKitUsageDescription
  • Location – NSLocationUsageDescription, NSLocationAlwaysUsageDescription, NSLocationWhenInUseUsageDescription
  • Media Library – NSAppleMusicUsageDescription
  • Microphone – NSMicrophoneUsageDescription
  • Motion – NSMotionUsageDescription
  • Photos – NSPhotoLibraryUsageDescription
  • Reminders – NSRemindersUsageDescription
  • Speech Recognition – NSSpeechRecognitionUsageDescription
  • SiriKit – NSSiriUsageDescription
  • TV Provider – NSVideoSubscriberAccountUsageDescription


No comments:

Post a Comment