tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.86k stars 2.46k forks source link

[docs] How to Embedding Additional Files at IOS? #10645

Open Nash-x9 opened 1 month ago

Nash-x9 commented 1 month ago

Thks for awesome project, I tried to create IOS app,it has a default sqlite database , How to Embedding Additional Files? I do it https://v2.tauri.app/develop/resources/ step by step , I got a error when permission add . src-tauri/capabilities/main.json

    "fs:allow-read-text-file",
    "fs:allow-resource-read-recursive"
image
ConnorKrammer commented 3 weeks ago

Just a quick sanity check: if you open up src-tauri/capabilities/main.json, do you have those two permission types inside the permissions entry?

The file should be of a format like:

{
  "identifier": "main",
  "description": "main permissions",
  "local": true,
  "windows": [
    "main"
  ],
  "permissions": [
    "core:default",
    "core:window:allow-maximize",
    "core:window:allow-unmaximize"
  ]
}

In this case, you can see that the permissions core:default, core:window:allow-maximize, and core:window:allow-unmaximize are enabled. Your code seems to need fs:allow-read-text-file and fs:allow-resource-read-recursive, so they will need to be in that list in your own capabilities file to enable them.