From e28c4d0003a9a6a33e0b37134496e6596943f6c3 Mon Sep 17 00:00:00 2001 From: Yusuf Suleman Date: Sat, 4 Apr 2026 22:40:43 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20camera=20crash=20=E2=80=94=20add=20NSCam?= =?UTF-8?q?eraUsageDescription=20+=20availability=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../Features/Assistant/AssistantChatView.swift | 10 ++++++---- ios/Platform/Platform/Info.plist | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ios/Platform/Platform/Features/Assistant/AssistantChatView.swift b/ios/Platform/Platform/Features/Assistant/AssistantChatView.swift index 77ee4dc..68852de 100644 --- a/ios/Platform/Platform/Features/Assistant/AssistantChatView.swift +++ b/ios/Platform/Platform/Features/Assistant/AssistantChatView.swift @@ -87,10 +87,12 @@ struct AssistantChatView: View { // Input bar HStack(alignment: .bottom, spacing: 10) { Menu { - Button { - showCamera = true - } label: { - Label("Take Photo", systemImage: "camera") + if UIImagePickerController.isSourceTypeAvailable(.camera) { + Button { + showCamera = true + } label: { + Label("Take Photo", systemImage: "camera") + } } Button { diff --git a/ios/Platform/Platform/Info.plist b/ios/Platform/Platform/Info.plist index 8ea01b7..450327d 100644 --- a/ios/Platform/Platform/Info.plist +++ b/ios/Platform/Platform/Info.plist @@ -6,5 +6,7 @@ ITSAppUsesNonExemptEncryption + NSCameraUsageDescription + Take a photo of your meal to log it with AI