fix: camera crash — add NSCameraUsageDescription + availability check
Crash: iOS terminates the app when accessing camera without the privacy description in Info.plist. Fix: - Added NSCameraUsageDescription to Info.plist - "Take Photo" option only shows if camera is available (UIImagePickerController.isSourceTypeAvailable(.camera)) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -87,11 +87,13 @@ struct AssistantChatView: View {
|
||||
// Input bar
|
||||
HStack(alignment: .bottom, spacing: 10) {
|
||||
Menu {
|
||||
if UIImagePickerController.isSourceTypeAvailable(.camera) {
|
||||
Button {
|
||||
showCamera = true
|
||||
} label: {
|
||||
Label("Take Photo", systemImage: "camera")
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
showPhotoPicker = true
|
||||
|
||||
@@ -6,5 +6,7 @@
|
||||
<true/>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>Take a photo of your meal to log it with AI</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Reference in New Issue
Block a user