#deeplinking permission issue

15 messages · Page 1 of 1 (latest)

deft crow
#

i have tried to print page using tauri deep link, but there is an issue with permissions

#info
[✔] Environment
    - OS: Windows 10.0.26100 x86_64 (X64)
    ✔ WebView2: 135.0.3179.85
    ✔ MSVC: Visual Studio Enterprise 2022
    ✔ rustc: 1.86.0 (05f9846f8 2025-03-31)
    ✔ cargo: 1.86.0 (adf9b6ad1 2025-02-28)                                                
    ✔ rustup: 1.28.1 (f9edccde0 2025-03-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.12.0
    - pnpm: 10.8.0
    - npm: 10.5.0

[-] Packages
    - tauri 🦀: 2.5.1
    - tauri-build 🦀: 2.2.0
    - wry 🦀: 0.51.2
    - tao 🦀: 0.33.0
    - @tauri-apps/api : 2.5.0
    - @tauri-apps/cli : 2.5.0

[-] Plugins
    - tauri-plugin-single-instance 🦀: 2.2.3
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-deep-link 🦀: 2.2.1
    - @tauri-apps/plugin-deep-link : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite
#
#error
error: failed to run custom build command for `silent-print v0.1.0 (C:\My Projects\tauri\silent-print\silent-print\src-tauri)`

Caused by:
  process didn't exit successfully: `C:\My Projects\tauri\silent-print\silent-print\src-tauri\target\debug\build\silent-print-3527206dd6e57240\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=TAURI_CONFIG
  cargo:rustc-check-cfg=cfg(desktop)
  cargo:rustc-cfg=desktop
  cargo:rustc-check-cfg=cfg(mobile)
  cargo:rerun-if-changed=C:\My Projects\tauri\silent-print\silent-print\src-tauri\tauri.conf.json
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_APP_NAME=app
  cargo:rustc-env=TAURI_ANDROID_PACKAGE_NAME_PREFIX=com_silent_1print
  cargo:rustc-check-cfg=cfg(dev)
  cargo:rustc-cfg=dev
  cargo:PERMISSION_FILES_PATH=C:\My Projects\tauri\silent-print\silent-print\src-tauri\target\debug\build\silent-print-8b8b05d7d0392411\out\app-manifest\__app__-permission-files
  cargo:rerun-if-changed=capabilities
  Permission opener:default not found, expected one of core:default, core:app:default, core:app:allow-app-hide....
#

<@&1115985763423748227> can anyone help with this?

ebon zinc
#

to fix the issue, read the last line of the error. It's complaining about a permission for the opener plugin so it's not related to deep linking. To fix it, simply remove the opener:default permission, or register the plugin in rust if you need it.

deft crow
versed mountain
#

Not sure if related, but you forgot to initialize the deeplink plugin:

builder = builder.plugin(tauri_plugin_deep_link::init());
Tauri

Set your Tauri application as the default handler for an URL.

ebon zinc
ebon zinc
deft crow
#

config is looks like this

"plugins": {
        "deep-link": {
            "desktop": {
                "schemes": ["silent-print"]
            }
        }
    }
deft crow
#

found the solution

match app
                .handle()
                .deep_link()
                .register("silent-print")
            {
                Ok(_) => info!("Protocol registered successfully"),
                Err(e) => error!("Failed to register protocol: {}", e),
            }