38 lines
1.4 KiB
Rust
38 lines
1.4 KiB
Rust
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
pub fn run() {
|
|
let builder = tauri::Builder::default()
|
|
.plugin(tauri_plugin_log::Builder::new().level(tauri_plugin_log::log::LevelFilter::Info).build())
|
|
.plugin(tauri_plugin_notification::init());
|
|
|
|
let builder = builder
|
|
.plugin(tauri_plugin_deep_link::init())
|
|
.plugin(tauri_plugin_opener::init());
|
|
|
|
#[cfg(any(target_os = "ios", target_os = "android"))]
|
|
let builder = builder.plugin(tauri_plugin_barcode_scanner::init());
|
|
|
|
#[cfg(any(target_os = "ios", target_os = "android"))]
|
|
let builder = builder.plugin(tauri_plugin_app_events::init());
|
|
|
|
if let Err(error) = builder
|
|
.setup(|_app| {
|
|
#[cfg(any(target_os = "linux", windows))]
|
|
{
|
|
use tauri_plugin_deep_link::DeepLinkExt;
|
|
|
|
if let Err(error) = _app.deep_link().register_all() {
|
|
if cfg!(debug_assertions) {
|
|
eprintln!("Skipping deep link registration during dev: {error}");
|
|
} else {
|
|
return Err(error.into());
|
|
}
|
|
}
|
|
}
|
|
Ok(())
|
|
})
|
|
.run(tauri::generate_context!())
|
|
{
|
|
eprintln!("error while running tauri application: {error}");
|
|
panic!("error while running tauri application: {error}");
|
|
}
|
|
}
|