Hello @Yiannis B ,
The underlying platform about Mac that supports MAUI uses Mac Catalyst, NSWorkspace
is not available for MacCatalyst, it's available on macOS 10.0+.
I am trying to open a file (pdf) using the default OSX application
You could try using Launcher to open another app via a file. Or try to use UIDocumentInteractionController, or try to use PDFView(PDFView cannot open another app).
In addition, MacCatalyst apps are granted access to a part of AppKit in the SDK by Apple. If you need the full Mac Platform API Support with MAUI/MacCatalyst, you can create a feature request at https://github.com/dotnet/maui .
---Update---
This is a Catalyst limitation. Catalyst is essentially the iOS API running on a Mac and has limited functionality by Apple's design. It uses iOS's UIKit rather than MacOS's AppKit. So, you can use UIApplication.SharedApplication.OpenUrlAsync
instead of NSWorkspace.shared.openFile
, and it will open the share options menu.
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.