Hi all,
I want to save a image locally, maybe in Documents
or Gallery. But How can I do that?
Here is my code:
const canvas = await html2canvas(
document.querySelector("#beautifulImage") as any
)
const res = await Filesystem.writeFile({
path: `myImage.png`,
data: canvas.toDataURL(),
directory: Directory.Documents,
})
However, it comes error and say: directory is not created!!!
Finally, I found this works: addandroid:requestLegacyExternalStorage="true"
in the application
tag in the AndroidManifest.xml
, however, the document said, it won’t work on android 11 or newer???
How can I do it correctly?
1 post - 1 participant