While using writeFile() in Capacitor/FileSystem in Android 13 error shows denied permission
These are the permissions I use:
Below is the code i use:
let permission = await Filesystem.requestPermissions();
if (permission.publicStorage == "granted") {
let apiData = data?.split(',')[1];
await Filesystem.writeFile({
path: `Appname/Filename.pdf`,
data: apiData,
directory: Directory.Documents,
recursive: true
});
}
This Works fine upto Android API level 30 For API level 33 Work around is given in the comments, still direct saving in documents directory is denied in capacitor 4.8.0