Universal (MacOS and iOS) iCloud path to file? Is there a way to get a universal path to a file in the iCloud directory? That is, a way to copy a path to a file stored in iCloud which will correctly direct to the file whether you use the path on iOS or MacOS?

Specifically, I'd like to link to an iCloud file in my Bear note taking app. However, I want this link to correctly function whether I use it from my Mac or from my iOS devices. Is there a way I can get such a link?

Edit:
Ideally, a solution which also works offline would be best. For example, on the Mac, a link such as file:///Users/username/Library/Mobile Documents/com~apple~Preview/Documents/my_file.pdf will reveal the linked file. However, this doesn't work on iOS. An equivalent link which works both on iOS and MacOS would be the ideal case. The first solution provided works as a device agnostic link, however, it does require an internet connection.
Not sure if this will do exactly what you want, but here's how to get a link to a file stored in iCloud:

On your Mac:


In Finder, open your iCloud Drive (found in the Go menu or Shift+Command+I)
Right click on the file and choose Share > Show People
Expand Share Options and adjust permissions as needed
Click Copy Link


On your iPhone/iPad:


Go to the Files app
Tap the file to open it
Tap the share icon (bottom left)
Tap Add People
Adjust Share Options as needed
Tap Copy Link


On the web:


Go to Drive on iCloud
Click to highlight the file
Click the Add People icon in the top menu bar
Click Copy Link
Adjust permissions and click Share
The shareable URL will shown