iOS Cordova应用程序更新后看不到用cordova.plugin.file保存的图像 [英] iOS cordova app not seeing images saved with cordova.plugin.file after app update
问题描述
iOS Cordova应用程序更新后看不到本地保存的图像.在此之前,一切正常.如何使用cordova.plugin.file动态设置相对URL?
iOS Cordova application does not see locally saved images after app update. Before that everything works fine. How do i set dynamically relative url with cordova.plugin.file?
我在config.xml中使用过:
I used in config.xml:
<preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
<preference name="iosPersistentFileLocation" value="Library" />
cordova.plugin.file将数据保存到:
The cordova.plugin.file saves data to:
cordova.file.dataDirectory;
但是在应用程序更新后,它们从文件夹中消失了,我在控制台中看到了它们.我阅读了有关更新后ios复制文件的信息,我必须设置从照相机本地保存的图像的相对路径.但是我不知道如何让ios看到图像.
But after app update they disappear from the folder i see them in in console. I read about ios copying files after update and that i have to set relative path to the images that i save locally from camera. But i do not know how to do it for ios to see the images.
推荐答案
好吧,事实是我将它们保存到了temp目录,ios在应用程序更新时将其清除.开始将图像保存到Documents/目录后,一切开始正常运行.
Well, the thing was that I saved them to a temp directory, which is cleared by ios on app update. After I started saving the images to the Documents/ directory, everything started working fine.
在此处查看文档 https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/
这篇关于iOS Cordova应用程序更新后看不到用cordova.plugin.file保存的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!