I did something similar in a project called IAnyLink
Since the "callback URLs" introduced with Android 3.0.5 are not yet easy enough to use on their own, I would like to maintain my feature request - general link.
I would like Joplin to offer a solution like the one presented by @benlau .
If Joplin were to host this as a project, I'd heavily encourage using my Client Side JS above.
It's a minimal text file that can be hosted on a CDN, it's entirely stateless, with no databases or services running beyond the HTTP server itself. That means that yes, Github Pages can host it entirely for free, that's how I originally used it (except in work itself, where its on our own domain/Apache2).
The end result is the same but the technical implementation is significantly different, a 1KB text file in a Git repo that hasn't changed once in 3 years is hard to beat.
Yes there's one minor known defect (that doesn't even effect the Joplin URLs), if that is problematic for Joplin, it's likely significantly easier to work around it than to rearchitect the whole thing.
@laurent , what is your opinion of @james-carroll 's approach?
I still hope that Joplin will do it.
It's possible to implement what called "App Links" by Android and called "Universal Links" by iOS; @Coffee has linked to the Android development docs on that.
The idea is that every note have a canonical URL that could possibly be opened in an ordinary browser (but it doesn't need to), and if user installed Joplin app, the app can intercept those URLs and open it in the app.
So we could probably have note URLs like:
https://joplincloud.com/note/ebcd30d052bb46bbb87353beeda96089
and configure Joplin app to intercept https://joplincloud.com/note/*
and open the corresponding note in the app.
joplincloud.com
will need to serve two files to explicitly express that it allow specified app to intercept links to it: /.well-known/assetlinks.json
for Android, /apple-app-site-association
for iOS, each containing specified app ID/package name and signing certificate's hash.
The issue would be that every user trying to open notes with those URLs will hit joplincloud.com
to obtain the association file, and probably will hit those canonical note URLs if user haven't installed the app, intentionally testing it, or unintentionally shared the link.
Those URLs on the server probably need to display a descriptive page saying that these URLs can only be opened in Joplin, probably provide a link to install the app. Serving these files/pages could incur additional cost. And it could have privacy issues too, as the server is possible to get user's IP and the note's IDs they trying to open.
So ... yes, technically it's doable. But it has additional administrative cost on the website need to consider.
Considering mine with the ability to integrate the mobile apps a bit more; I'd imagine a revised approach would be:
- Use App Links as described by Tib as the primary solution, due to the better UX
- Keep the core concept of the universal link idea but ammend the logic to work on Anchors rather than URL Parameters, for situations the above doesn't work.
2.1) Add a huge "Install/Open Joplin" button, to cover people who don't have it installed at all. Unfortunately I don't think this covers people without JS.
So I'm no web tech, but from what I've seen in e.g Bitwarden or Protonmail, the browser doesn't send anchors as part of the HTTP payload, so hypothetically e.g:
joplincloud.com/redirect#noteID
Is all you need.
Unlike my (original) example, we know the target is always joplin://
, so there's no point including it and making it impossible for malicious users to change it to e.g steam://
is a huge win.
And secondly, the server doesn't recieve the note ID at all, even in any HTTP logs, becuase the browser physically never sends the NoteID to the server.
So following, it's still stateless and cheap, since it's all client side logic (all files including the App Link JSON files are static).
I still have hope that Joplin will do it.
I still have hope that Joplin will do it.
This post is to prevent the topic from being automatically closed.
This topic will close a year after the last reply.
Folks, just check the following thread.
I think it is 90% a solution here.
I can just do a keyboard shortcut on the desktop app and this plugin copies the universal link into the clipboard.
Then I can paste in Whatsapp, Twitter, wherever.
It's clickable and works both on Windows and IOS - haven't tested other OS.
Laurent even sponsored the author of this plugin