[英]iOS cordova app not seeing images saved with cordova.plugin.file after app update
iOS Cordova application does not see locally saved images after app update. 应用更新后,iOS Cordova应用程序看不到本地保存的图像。 Before that everything works fine. 在此之前,一切正常。 How do i set dynamically relative url with cordova.plugin.file? 如何使用cordova.plugin.file动态设置相对URL?
I used in config.xml: 我在config.xml中使用:
<preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
<preference name="iosPersistentFileLocation" value="Library" />
The cordova.plugin.file saves data to: cordova.plugin.file将数据保存到:
cordova.file.dataDirectory;
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. 我阅读了有关更新后ios复制文件的信息,并且我必须为从相机本地保存的图像设置相对路径。 But i do not know how to do it for ios to see the images. 但是我不知道如何为ios看到图像。
Well, the thing was that I saved them to a temp directory, which is cleared by ios on app update. 好吧,我把它们保存到了一个临时目录,iOS在应用程序更新时将其清除。 After I started saving the images to the Documents/ directory, everything started working fine. 开始将图像保存到Documents /目录后,一切正常。
See docs here https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/ 在此处查看文档https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.