-
I have this very simple function that is basically the same as the Camera Capture UI Uno.Sample project (except for the conversion to a BitmapImage). public static async Task<StorageFile> View_CameraPhotoCapture()
{
//PhotoCaptureAsync_WinSDK();
//CapturePhotoWIA();
//FeatureRequest("Camera Photo Capture");
try
{
var captureUI = new CameraCaptureUI();
captureUI.PhotoSettings.Format = CameraCaptureUIPhotoFormat.Jpeg;
captureUI.PhotoSettings.CroppedSizeInPixels = new Size(200, 200);
var photo = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Photo);
return photo;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex);
}
return null;
} But the iOS app crashes in the capture.UICaptureFileAsync() method call. The output isn't too helpful (at least not for me at my level of understanding).
Is CameraCaptureUI currently broken? Am I doing something wrong? What's the best way to debug this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey @trydalch, thank you for sharing details. Although, I am not able to test on iOS from my side, could you please test if the issue also occurs on: unoplatform/Uno.Samples#801. Thank you! |
Beta Was this translation helpful? Give feedback.
Hey @morning4coffe-dev. Thanks, I should've tried the sample first instead of just using it as a reference point. I'll be sure to do that in the future before opening issues.
The sample runs just fine. Our issue was that we did not have the proper entry in our Info.plist file in order to request camera permissions.
I suspect it crashed instead of throwing a more easily handled error because we had previously written an app with Expo using the same bundle ID and I had already granted camera permissions. So it was probably this weird state where the OS believed I had granted the app permissions already, yet the app no longer had the right Info.plist file. Blew up.
Added this snippet to our …