Replying to myself:
https://developer.apple.com/documentation/fileprovider/macos_support/syncing_files_on_macos
Also, all the WWDC sample code is here:
https://developer.apple.com/sample-code/wwdc/2021
Post
Replies
Boosts
Views
Activity
So the solution is to add a continue user activity handler on a suitable view: }
It's not obvious why the same Universal Link received through a click on a link in Safari should be handled differently than the same link read from a tag, but apparently it's not the same thing.
The same thing happens when you scan an NFC tag containing the URL. At least me and someone else have this issue:
https://stackoverflow.com/questions/65150897/swiftui-universal-links-not-working-for-nfc
Their work-around is to use a custom URL scheme, but since that's frowned upon these days it would be nice if this was fixed. I assume it's an issue in SwiftUI (or maybe something lower level - I haven't written a UIKit test app to narrow down where the URL ges lost).
I did make a quick test to see if custom schemes work, but I could only get it to work when scanning a QR code - not when scanning an NFC tag.