Vor kurzem habe ich diesen Fehler erhalten:
NSPhotoLibraryUsageDescription-Schlüssel muss in Info.plist für .__ vorhanden sein. Kamerarolle verwenden.
Ich verwende React Native, um meine App zu erstellen (ich bin nicht mit der Entwicklung von ios native vertraut), und ich weiß nicht, wie ich diesen Schlüssel zu Info.plist hinzufügen kann
Kannst du ein Beispiel posten? Vielen Dank
Ich verwende das npm-Paket "react-native-camera-roll-picker": "^1.1.7"
Vielen Dank @rmaddy, ich habe dies direkt nach anderen Schlüssel-String-Paaren in Info.plist hinzugefügt und das Problem behoben:
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo Library Access Warning</string>
Bearbeiten:
Ich hatte auch ähnliche Probleme mit verschiedenen Komponenten meiner App. Am Ende wurden alle diese Schlüssel hinzugefügt (nachdem auf Xcode8/iOS10 aktualisiert wurde):
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app does not require access to the microphone.</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera.</string>
Überprüfen Sie diesen developer.Apple.com - Link auf vollständige Liste der Referenzen der Eigenschaftsliste.
Volle Liste:
Apple Music:
<key>NSAppleMusicUsageDescription</key>
<string>My description about why I need this capability</string>
Bluetooth:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>My description about why I need this capability</string>
Kalender:
<key>NSCalendarsUsageDescription</key>
<string>My description about why I need this capability</string>
Kamera:
<key>NSCameraUsageDescription</key>
<string>My description about why I need this capability</string>
Kontakte:
<key>NSContactsUsageDescription</key>
<string>My description about why I need this capability</string>
FaceID:
<key>NSFaceIDUsageDescription</key>
<string>My description about why I need this capability</string>
Gesundheitsanteil:
<key>NSHealthShareUsageDescription</key>
<string>My description about why I need this capability</string>
Gesundheitsupdate:
<key>NSHealthUpdateUsageDescription</key>
<string>My description about why I need this capability</string>
Heimtrikot:
<key>NSHomeKitUsageDescription</key>
<string>My description about why I need this capability</string>
Ort:
<key>NSLocationUsageDescription</key>
<string>My description about why I need this capability</string>
Standort (immer):
<key>NSLocationAlwaysUsageDescription</key>
<string>My description about why I need this capability</string>
Standort (Wenn verwendet):
<key>NSLocationWhenInUseUsageDescription</key>
<string>My description about why I need this capability</string>
Mikrofon:
<key>NSMicrophoneUsageDescription</key>
<string>My description about why I need this capability</string>
Bewegung (Beschleunigungsmesser):
<key>NSMotionUsageDescription</key>
<string>My description about why I need this capability</string>
NFC (Nahfeldkommunikation):
<key>NFCReaderUsageDescription</key>
<string>My description about why I need this capability</string>
Fotobibliothek:
<key>NSPhotoLibraryUsageDescription</key>
<string>My description about why I need this capability</string>
Fotobibliothek (schreibgeschützt):
<key>NSPhotoLibraryAddUsageDescription</key>
<string>My description about why I need this capability</string>
Erinnerungen:
<key>NSRemindersUsageDescription</key>
<string>My description about why I need this capability</string>
Siri:
<key>NSSiriUsageDescription</key>
<string>My description about why I need this capability</string>
Spracherkennung:
<key>NSSpeechRecognitionUsageDescription</key>
<string>My description about why I need this capability</string>
Sie müssen diese beiden in Ihre info.plist einfügen. Die einzige Möglichkeit, die in iOS 11 für mich funktioniert hat.
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires access to the photo library.</string>
Für den Kamerazugriff verwenden Sie:
<key>NSCameraUsageDescription</key>
<string>Camera Access Warning</string>
Zum Speichern oder Abrufen eines Bildes von der Kamerarolle. Darüber hinaus müssen Sie den Benutzer nach der Erlaubnis fragen, sonst wird dieser Fehler angezeigt, oder Ihre App kann abstürzen. Um sich das zu ersparen, fügen Sie dies in Ihre info.plist ein
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires read and write permission from the user.</string>
Im Fall von Xamarin.iOS
if you're adding it from the generic editor then "Privacy - Photo Library Additions Usage Description" will be the given option you will find out instead of "NSPhotoLibraryAddUsageDescription".
"Privacy - Photo Library Additions Usage Description" for iOS 11 and later
"Privacy - Photo Library Usage Description" for iOS 6.0 and later
Öffnen Sie die Plist-Datei und diesen Code
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>This app requires access to the photo library.</string>