I’m developing a note-taking application with Electron which I would like to publish on the Snapstore when ready.
Originally, I was storing notes in the
SNAP_USER_COMMON directory, however, then I discovered that if someone removes the Snap from their system, all of their note data would be deleted too, which is potentially not what they would want.
Because of this, I’ve decided it is probably best to store the notes somewhere more visible, like in a users Documents directory within their home (
/home/winterdj/Documents/notes for example), and so that if the snap is uninstalled, their notes are preserved, and they can delete if they choose too.
Based on everything I’ve read, it seems that that would involve the Snap needing the
personal-files interface so that it would be able to read/write from that directory. And also, that interface would not auto-connect when installed.
Is there a way I can locally install a Snap with
--dangerous but with the confinements and interface restrictions in place, as if someone had installed via the Snapstore? I’ve tried
--dangerous --jailmode but with no success.
Also, my thinking is that asking a user to manually connect the interface after install in order for the app to be able to read/write notes is not going to be a great user experience. So after some more reading, I saw that I can make a request on this forum to have the
personal-files interface auto-connect specifically for my snap?
I’d appreciate any guidance/advice around being able to read/write files from a directory within a users home directory. I’m quite new to Snap development, so all of the above is what I have so far pieced together from documentation and various forum posts.