Copying files via UIPasteboard in Catalyst - Sandbox problem?

Hi everybody,


in my app I would like to provide the ability to copy files stored inside the app to the Files app or the Finder in macOS using Catalyst.


On iOS, everything works fine with the following code:


            if let provider = NSItemProvider(contentsOf: url) {
            
                provider.suggestedName = pdfFilename

                UIPasteboard.general.url = url
                UIPasteboard.general.itemProviders = [provider]
            }


But on macOS this doesn't work, if I execute this code I get the messages:


[sandbox] CreateSandboxExtensionData failed: url null

[general] Sandbox extension data required immediately for flavor public.file-url, but failed to obtain.


Does anyone have an idea what I have to do here?

Copying files via UIPasteboard in Catalyst - Sandbox problem?
 
 
Q