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

Upload plugin mobile support

Open gato25 opened this issue 1 year ago • 1 comments

Is it possible to use upload plugin in mobile ?

{
    "$schema": "../gen/schemas/mobile-schema.json",
    "identifier": "mobile-capability",
    "windows": [
        "main"
    ],
    "platforms": [
        "iOS",
        "android"
    ],
    "permissions": [
        "upload:allow-download"
    ]
}

but this gives me an error Uncaught (in promise) upload.download not allowed on window main, webview main, allowed windows: , allowed webviews: , referenced by

Am i doing something wrong? Or its not implemented yet?

gato25 avatar Apr 07 '24 13:04 gato25

Can you test whether this error still happens in rc ? If so, i'll mark this as an upstream issue since the error makes no sense here (even though i assume the plugin doesn't reallyyy work on mobile apart from this issue)

FabianLars avatar Aug 07 '24 13:08 FabianLars

is there any update on this, it is quite annoying if an app can't do download

YuenSzeHong avatar Jan 07 '25 07:01 YuenSzeHong

Here's the current status for Android:

  • Do you want to download into the application specific directory? -> Already works.
  • Do you want to use dialog.saveFile as the target path? -> Missing file descriptor conversion like in the fs plugin. Fairly easy to add but requires a tiny bit of kotlin sadly.
  • Do you want to write into the Downloads dir without asking for it? -> This one is a bit of a mess. I think on old Android versions it may just work if you add the WRITE_EXTERNAL_STORAGE permission but on newer android versions something is missing and i'm getting very mixed results when i try to look it up.

FabianLars avatar Jan 07 '25 12:01 FabianLars

Here's the current status for Android:

  • Do you want to download into the application specific directory? -> Already works.
  • Do you want to use dialog.saveFile as the target path? -> Missing file descriptor conversion like in the fs plugin. Fairly easy to add but requires a tiny bit of kotlin sadly.
  • Do you want to write into the Downloads dir without asking for it? -> This one is a bit of a mess. I think on old Android versions it may just work if you add the WRITE_EXTERNAL_STORAGE permission but on newer android versions something is missing and i'm getting very mixed results when i try to look it up.

I want to write to the Downloads, and I am on android 10+, uses different API to write to Downloads folder, namely MediaStore API, and we don't seem to need to ask for it in runtime anymore

just to clarify, the app specific directory is Android/data/com.example.app?

YuenSzeHong avatar Jan 10 '25 06:01 YuenSzeHong

Something that came up in https://github.com/tauri-apps/plugins-workspace/issues/2749 - the plugin currently also (likely) does not support content:// urls.

FabianLars avatar Jun 07 '25 15:06 FabianLars