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:

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