/// Extensions to [`tauri::App`], [`tauri::AppHandle`], [`tauri::WebviewWindow`], [`tauri::Webview`] and [`tauri::Window`] to access the deep-link APIs.
pubtraitDeepLinkExt<R: Runtime>{
@ -449,6 +457,54 @@ impl<R: Runtime, T: Manager<R>> crate::DeepLinkExt<R> for T {
}
}
/// Event that is triggered when the app was requested to open a new URL.
///
/// Typed [`tauri::Event`].
pubstructOpenUrlEvent{
id: EventId,
urls: Vec<Url>,
}
implOpenUrlEvent{
/// The event ID which can be used to stop listening to the event via [`tauri::Listener::unlisten`].
pubfnid(&self)-> EventId{
self.id
}
/// The event URLs.
pubfnurls(self)-> Vec<Url>{
self.urls
}
}
impl<R: Runtime>DeepLink<R>{
/// Handle a new deep link being triggered to open the app.
///
/// To avoid race conditions, if the app was started with a deep link,
/// the closure gets immediately called with the deep link URL.