Hi, can you give me simple example of how to create file on android and desktop(mac)?
I installed fs plugin.
For Android i've added permissions to manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
...
Also i've edited capabilities/default.json:
"permissions": [
"core:default",
"opener:default",
"fs:default",
"fs:allow-create", // added
I try to create file within my react component:
useEffect(() => {
async function createFile() {
try {
const file = await create("foobar.txt", {
baseDir: BaseDirectory.AppData,
});
setState("FileCreated");
console.debug("File created successfully!");
} catch (error) {
setState(error);
}
}
createFile();
}, []);
And got Error:
On tauri android dev : forbidden path: /data/user/0/com.bank_note.app/foobar.txt
On tauri dev: forbidden path: /Users/philipp/Library/Application Support/com.bank-note.app/foobar.txt
What did i do wrong?