-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(deep-link): Add deep link support for desktop #916
Conversation
This looks interesting, is this on hold for the moment whilst v2 is finalised? |
it was waiting for the beta release with the big allowlist/ACL changes, yes. Since then i was out sick so i couldn't work on this yet. This week i've also talked with a community member about the url handling mess in the context of cross platform support (android, ios, macos have an explicit event and are single instance by default, while linux and windows spawn a new instance that gets the url as a cli arg), and i'm not sure how, or if at all to handle it yet, maybe it will be in a follow up pr idk. |
single-instance should not be handled by deep-link, it should be handled by the single-instance plugin |
i did not forget about your stance on this topic :P And that's also not reallyyy what i meant, i agree that the deep link plugin shouldn't change this behavior. I'll have to find the discussions again to remember what i actually meant though lol. We at least need more docs to show how to handle this, or at least stating the platform differences. Anyway, no major changes are planned. |
@FabianLars is this plugin ready for release since deep-links was merged into tauri v2? i'd love macos/linux/windows support added to the current mobile plugin. |
not quite. If it's enough to register the schemes at install time, and not at runtime, then using the latest tauri cli already support that. The plugin only adds apis to un/register schemes at runtime. |
@FabianLars is there documentation on how to do desktop deep linking with the latest tauri cli? |
No, here's how to configure it: https://github.com/tauri-apps/plugins-workspace/pull/916/files#diff-98b5031760ba756df7078118e3724551064a6b92fe1537a0a19ca5daacdda748 (This already works as long as you don't need mobile and therefore don't include this plugin in your project) You can get the invoked links on macOS like on iOS: https://beta.tauri.app/features/deep-linking/#usage On Windows and Linux this will open a new instance with the url in the cli args (accessible in rust via |
ohh okay thx thats a fine solution imo |
I think it would be valuable to add a Rust event (maybe a closure) for the new-url event, currently it's tricky to get the URLs because the current value is filled after emitting the webview event. |
I'm a bit dense today, could you explain the issue differently somehow? 😅 |
nvm we can just document the new-url event payload format and users deserialize manually |
i didn't test the linux changes i just pushed but will mark this as ready for review already because yolo (rly tho please review it, and if you test the linux implementation for me that'd be even better 🙃) assuming everything is correct, and we're happy with the UnsupportedPlatform error, the only thing left to do is adding desktop support to the example and adding the single-instance plugin to the readme as requested by Amr. |
probably a good idea to split it into multiple files per platform cause those cfg flags are urgh |
How to register a schema?
Is it not ready yet? |
You can do this: https://github.com/tauri-apps/plugins-workspace/pull/916/files#diff-98b5031760ba756df7078118e3724551064a6b92fe1537a0a19ca5daacdda748 to make the app register them on installation. Or you use the good old register functions to register them at runtime, yes. |
@FabianLars Can I use it right now? Like so tauri-plugin-deep-link = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "desktop-deep-links" } I need to migrate Tauri v1 application to v2, but it uses the schema functionality |
@FabianLars are there docs for this since its been merged now? |
No, i did not expect that this would get merged as-is (see my comments above), yet alone actually released, so i didn't work on docs. I can't give you an ETA on it right now. |
needs tauri-apps/tauri#8680