plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

tauri-plugin-opener: mobile support

Open proemian opened this issue 5 months ago • 9 comments

I'm sorry if this is a duplicate. I can see that support for iOS and Android in tauri-plugin-opener are marked with ?, but I could not find an open issue.

For my oauth flow I need to open a browser window, but this seems to break on iOS. It works on desktop.

  • iOS version: 26.0 (23A5326a)
  • Tauri version: 2.8.4
  • tauri-plugin-opener version: 2.2.3
  • Capability permissions: ["core:default", "opener:default", "shell:default", "store:default"]

Simplified code:

    tauri_plugin_opener::open_url("https://www.google.com", None::<&str>)
        .map_err(|err| err.to_string())?;

Error received: Operation not permitted (os error 1)

proemian avatar Aug 26 '25 13:08 proemian

can you include the output of tauri info? The ? is incorrect, mobile is supposed to work (for urls only)

FabianLars avatar Aug 26 '25 15:08 FabianLars

wouldn't be surprised if it's a change in ios 26 though, at least if we also take macos 26 into account it wouldn't be the first hidden breaking change

FabianLars avatar Aug 26 '25 15:08 FabianLars

and if you're actually on 2.2.3, try upgrading that to latest 2.2 (2.3.1 and above seems to be broken on mobile with a different os error)

FabianLars avatar Aug 26 '25 15:08 FabianLars

Thanks for the swift response.

The ? is based on the info on npm: https://www.npmjs.com/package/@tauri-apps/plugin-opener I will upgrade to the latest 2.2.x tomorrow, and try to get more info. Definitely could be caused by ios 26, I can probably test the stable os version in a simulator also.

proemian avatar Aug 26 '25 19:08 proemian

I have reproduced this in a vanilla project: https://github.com/proemian/tauri-opener.

Steps to reproduce:

  • ✅ Create project: npm create tauri-app@latest
  • ✅ Modify lib.rs and App.tsx to open browser window using tauri-plugin-opener
  • ✅ Test on desktop
  • ✅ Init mobile: npm run tauri ios init
  • ✅ Run on iPhone with iOS 26 (not simulator): npm run tauri ios dev
  • ❌ Click button, nothing happens 😕
  • 🐛 Inspect output in Safari devtools: Operation not permitted (os error 1)

Output from tauri info:

[✔] Environment
    - OS: Mac OS 15.6.1 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.89.0 (29483883e 2025-08-04)
    ✔ cargo: 1.89.0 (c24e10642 2025-06-23)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 22.12.0
    - pnpm: 8.8.0
    - yarn: 1.22.22
    - npm: 10.9.0
    - bun: 1.2.20

[-] Packages
    - tauri 🦀: 2.8.4
    - tauri-build 🦀: 2.4.0
    - wry 🦀: 0.53.3
    - tao 🦀: 0.34.2
    - tauri-cli 🦀: 2.8.0 (outdated, latest: 2.8.3)
    - @tauri-apps/api : 2.8.0
    - @tauri-apps/cli : 2.8.3

[-] Plugins
    - tauri-plugin-opener 🦀: 2.5.0
    - @tauri-apps/plugin-opener : 2.5.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

[-] iOS
    - Developer Teams: XXXX

I also tried using a simulator running iOS 17, and it also fails. This time the error in the Safari devtools is No such file or directory (os error 2).

proemian avatar Aug 28 '25 09:08 proemian

The android simulator seems to have a similar issue, failing with the error Permission denied (os error 13)

proemian avatar Aug 28 '25 15:08 proemian

I have the same exact error now on iOS device.

setoelkahfi@Heighliner1 splitfire-desktop % cargo tauri info

[✔] Environment
    - OS: Mac OS 15.7.0 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ Xcode: 16.4
    ✔ rustc: 1.89.0 (29483883e 2025-08-04)
    ✔ cargo: 1.89.0 (c24e10642 2025-06-23)
    ✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (overridden by environment variable RUSTUP_TOOLCHAIN)
    - node: 20.14.0
    - pnpm: 10.17.1
    - npm: 10.7.0

[-] Packages
    - tauri 🦀: 2.8.5
    - tauri-build 🦀: 2.4.1
    - wry 🦀: 0.53.3
    - tao 🦀: 0.34.3
    - tauri-cli 🦀: 2.8.4
    - @tauri-apps/api : 2.8.0
    - @tauri-apps/cli : 2.8.4

[-] Plugins
    - tauri-plugin-fs 🦀: 2.4.2
    - @tauri-apps/plugin-fs : 2.4.2
    - tauri-plugin-os 🦀: 2.3.1
    - @tauri-apps/plugin-os : 2.3.1
    - tauri-plugin-haptics 🦀: 2.3.0
    - @tauri-apps/plugin-haptics : 2.3.0
    - tauri-plugin-log 🦀: 2.7.0
    - @tauri-apps/plugin-log : 2.7.0
    - tauri-plugin-clipboard-manager 🦀: 2.3.0
    - @tauri-apps/plugin-clipboard-manager : 2.3.0
    - tauri-plugin-single-instance 🦀: 2.2.0, (outdated, latest: 2.3.4)
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-deep-link 🦀: 2.4.3
    - @tauri-apps/plugin-deep-link : 2.4.3
    - tauri-plugin-store 🦀: 2.4.0
    - @tauri-apps/plugin-store : 2.4.0
    - tauri-plugin-opener 🦀: 2.2.3, (outdated, latest: 2.5.0)
    - @tauri-apps/plugin-opener : 2.5.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../out
    - devUrl: http://localhost:1420/
    - framework: React (Next.js)
    - bundler: Webpack

setoelkahfi avatar Sep 25 '25 07:09 setoelkahfi

Ok, this is silly and I think I've been through this situation before. The openUrl in the JS frontend is not async, eventough it returns Promise.

Context is I'm opening an external URL using the openUrl in the frontend and the error comes up because I use await syntax, guessing it's an async operation with the Promise<void> being returned.

setoelkahfi avatar Sep 25 '25 07:09 setoelkahfi

This issue has unfortunately brought our Tauri project to a standstill, and we’re now having to evaluate alternative platforms.

Is there any known workaround for enabling Google OAuth in Tauri on mobile, or an expected timeline for a fix that could help us make an informed decision to stay with Tauri? 🙏 @FabianLars

We truly appreciate Tauri and have the deepest respect for the work and dedication behind this project. 🙌

All the best,

proemian avatar Nov 06 '25 15:11 proemian

I was trying to hunt this down for the past month, since previously opening up oauth worked just fine. My issued ended up being from a config change from deep-link it seemed:

    "deep-link": {
      "desktop": {
        "schemes": ["com.my.scheme"]
      },
      "mobile": [
        {
          "scheme": ["https"],
          "host": "myurl.com",
          "pathPrefix": ["/payment-success", "/payment-canceled", "/pricing"],
          "appLink": true
        }

Only affected android. Instead of just having host, put scheme, pathPrefix, and appLink. I believe the deeplink was preventing opener from actually opening the browser. I was on versions from ~april of this year, and recently updated to latest versions about a month ago where this broke. Something to double check.

AnthonyRonning avatar Dec 02 '25 19:12 AnthonyRonning