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,10 +87,12 @@ struct AssistantChatView: View {
|
|||||||
// Input bar
|
// Input bar
|
||||||
HStack(alignment: .bottom, spacing: 10) {
|
HStack(alignment: .bottom, spacing: 10) {
|
||||||
Menu {
|
Menu {
|
||||||
Button {
|
if UIImagePickerController.isSourceTypeAvailable(.camera) {
|
||||||
showCamera = true
|
Button {
|
||||||
} label: {
|
showCamera = true
|
||||||
Label("Take Photo", systemImage: "camera")
|
} label: {
|
||||||
|
Label("Take Photo", systemImage: "camera")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|||||||
@@ -6,5 +6,7 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
<false/>
|
<false/>
|
||||||
|
<key>NSCameraUsageDescription</key>
|
||||||
|
<string>Take a photo of your meal to log it with AI</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
Reference in New Issue
Block a user