You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the FilePicker API in an iOS application, the PickAsync method returns null (as if canceled) even if the user has not canceled or picked a file.
The issues reported by the simular-issues-ai are all relevant but do not cover this case, as they focus on Mac Catalyst, while I believe the same bug exists when running iOS apps that are not Catalyst on macOS.
follesoe
added a commit
to follesoe/maui
that referenced
this issue
Nov 4, 2024
Fixdotnet#25661 by only assigning the documentPicker.PresentationController.Delegate if the iOS app is not running on Mac. There is already a #if !MACCATALYST check to ensure this code is not compiled for Mac Catalyst apps, but we also need to guard against the same problem for iOS apps running on Mac.
Description
When using the
FilePicker
API in an iOS application, thePickAsync
method returns null (as if canceled) even if the user has not canceled or picked a file.The same behavior exists in the old Xamarin.Essentials library. On macOS Catalyst, I believe you have worked around the problem by adding in
#if !MACCATALYST
here: https://github.com/dotnet/maui/blob/main/src/Essentials/src/FilePicker/FilePicker.ios.cs#L41 - which is not present in https://github.com/xamarin/Essentials/blob/main/Xamarin.Essentials/FilePicker/FilePicker.ios.cs#L35However, I believe we are getting the "macOS Catalyst" behavior of the
UIDocumentPickerViewController
when an iOS app runs on an M-series Mac.One possible solution is using
NSProcessInfo.ProcessInfo.IsiOSApplicationOnMac;
to detect if the iOS app runs on macOS:Steps to Reproduce
PickAsync
returnsnull
even if file picker is not dismissed.Link to public reproduction project repository
No response
Version with bug
9.0.0-rc.2.24503.2
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: