Hi,
I’m storing images in filesystem and their paths in storage, so they can be uploaded to api later.
I have a question which I think is not answered in the documentation and I’m not sure I can test properly myself.
Can I store the path that function Capacitor.convertFileSrc()
generated, because it will always be the same after phone restarts and the app is open again on android/ios? Or should I store the uri
that Filesystem.copy
returned to me and always run convertFileSrc()
before reading the file?
Thank you.
If you are using live reload then the IP could change if you restart the router, if not using live reload then it doesn’t use an IP, it uses localhost
or the configured hostname, which won’t change unless you change it.
But also on iOS, every time you launch the app from Xcode, some parts of the image paths change. It shouldn’t change if the app is installed from the App Store, but will change for you, so storing the values would make the development of your app harder for you.
So it’s not a good idea to store the paths, it’s better to store the images in a specific folder and then use Filesystem.readDir
to get all the images in that folder.