If I remove ‘Download’ from path, it save my pdf file in Android/data/com.myapp/files/fileName, but I can’t access it from my smartphone.
If I kepp ‘Download’ or ‘Downloads’ or any different Directory, it totally doesn’t work.
But basically add MANAGE_EXTERNAL_STORAGE to your manifest. Or maybe add the path/to/your/downloads folder in the files/path.xml in the manifest (if on Android Studio is something like app/res/xml/files_path.xml).
Sorry for the late reply. I completely forgot this website existed for a second.
Ignore my other post and do this instead. I tested on my app and this worked. I haven’t deployed to the Play Store yet, so if you get errors from Google Play Console, just add <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/> if it asks for it.
The READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE are deprecated on Android 13 as per the docs.
Now on your phone, go to Android/data/io.my.app/files/my-directory and the directory with the files inside should be there. I couldn’t make it work so that the file writes to the download folder, sorry.
There’s Directory.EXTERNAL_STORAGE of the Directory prop from Capacitor Filesystem class, but the docs said that it is It's not accesible on Android 11 or newer..
Ciao Bandito!
Don’t worry about that! I solved it using download + share file. In this way I can open my file using a “pdf” reader and download my file using it.