dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

Maui .Net 8 iOS MediaPicker.CapturePhotoAsync issue returns null after user presses USE PHOTO on apple device #23254

Closed vsfeedback closed 4 months ago

vsfeedback commented 4 months ago

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version] Hi,

Maui .Net 8 iOS MediaPicker.CapturePhotoAsync issue returns null after user presses USE PHOTO on apple device.

This does however work perfectly on Windows and Android.

Code snippet: public async Task<List> TakePic(ContentPage page) { var Photos = new List();

Photo photo = new Photo();

try { await page. DisplayAlert("Debug", $"IsCaptureSupported {MediaPicker.Default.IsCaptureSupported}", "Ok"); if (MediaPicker.Default.IsCaptureSupported) { await page. DisplayAlert("Debug", $"taking pic", "Ok");

var photoFile = await MediaPicker.Default.CapturePhotoAsync(new MediaPickerOptions { Title = "Please take a photo" });

if (photoFile != null) //iOS returns null here?

Installed Packages:

    <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.4" />
    <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.60" />
    <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.60" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

I am getting the same results on iPad Air 2 iOS 15.8.2 and iPhone 8 iOS 16.3.1


Original Comments

Feedback Bot on 6/23/2024, 06:41 PM:

(private comment, text removed)


Original Solutions

(no solutions)

github-actions[bot] commented 4 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

jfversluis commented 4 months ago

Duplicate of #23197