diff --git a/.changes/deep-link-get-current-desktop.md b/.changes/deep-link-get-current-desktop.md index e03fef81..ffc3f83e 100644 --- a/.changes/deep-link-get-current-desktop.md +++ b/.changes/deep-link-get-current-desktop.md @@ -1,5 +1,6 @@ --- "deep-link": patch +"deep-link-js": patch --- Implement `get_current` on Linux and Windows. diff --git a/plugins/deep-link/guest-js/index.ts b/plugins/deep-link/guest-js/index.ts index e75c9d76..49afbab7 100644 --- a/plugins/deep-link/guest-js/index.ts +++ b/plugins/deep-link/guest-js/index.ts @@ -14,7 +14,9 @@ import { type UnlistenFn, listen } from '@tauri-apps/api/event' * const urls = await getCurrent(); * ``` * - * #### - **Windows / Linux**: Unsupported. + * #### - **Windows / Linux**: This function reads the command line arguments and checks if there's only one value, which must be an URL with scheme matching one of the configured values. + * Note that you must manually check the arguments when registering deep link schemes dynamically with [`Self::register`]. + * Additionally, the deep link might have been provided as a CLI argument so you should check if its format matches what you expect.. * * @since 2.0.0 */ diff --git a/plugins/deep-link/src/lib.rs b/plugins/deep-link/src/lib.rs index 4dafde7b..7b0e827a 100644 --- a/plugins/deep-link/src/lib.rs +++ b/plugins/deep-link/src/lib.rs @@ -108,6 +108,12 @@ mod imp { impl DeepLink { /// Get the current URLs that triggered the deep link. Use this on app load to check whether your app was started via a deep link. + /// + /// ## Platform-specific: + /// + /// - **Windows / Linux**: This function reads the command line arguments and checks if there's only one value, which must be an URL with scheme matching one of the configured values. + /// Note that you must manually check the arguments when registering deep link schemes dynamically with [`Self::register`]. + /// Additionally, the deep link might have been provided as a CLI argument so you should check if its format matches what you expect. pub fn get_current(&self) -> crate::Result>> { self.0 .run_mobile_plugin::("getCurrent", ())