Fix Camera support in certain iPhone models, fixes #736

This commit is contained in:
Lior Halphon
2026-01-29 00:01:26 +02:00
parent cdb0c56b1d
commit 7cf082bcc4
+7 -1
View File
@@ -1998,7 +1998,12 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
_cameraSession = [AVCaptureSession new];
_cameraSession.sessionPreset = AVCaptureSessionPreset352x288;
if ([device supportsAVCaptureSessionPreset:AVCaptureSessionPreset352x288]) {
_cameraSession.sessionPreset = AVCaptureSessionPreset352x288;
}
else if ([device supportsAVCaptureSessionPreset:AVCaptureSessionPresetMedium]) {
_cameraSession.sessionPreset = AVCaptureSessionPresetMedium;
}
[_cameraSession addInput: input];
[_cameraSession addOutput: _cameraOutput];
@@ -2010,6 +2015,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
@catch (NSException *exception) {
/* I have not tested camera support on many devices, so we catch exceptions just in case. */
GB_camera_updated(&_gb);
_cameraSession = nil;
}
});
}