简体   繁体   English

iOS Cordova应用程序更新后看不到用cordova.plugin.file保存的图像

[英]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.

相关问题 cordova-plugin-file:应用更新后无法访问文件 (iOS) - cordova-plugin-file: files not accessible after app update (iOS) 问题 Cordova 应用程序 iOS 在 WKWEBVIEW 上更新后,不加载本地文件 - Problem Cordova App iOS after update on WKWEBVIEW, not load local file iOS上的Cordova File插件将文件保存在哪里 - Where is the file saved by Cordova File plugin on iOS 要从cordova html页面(cordova)加载保存在iOS App Documents目录中的图像吗? - Load images saved in iOS App Documents directory from cordova html page (cordova)? Cordova Plugin CodePush-重新启动iOS App后更新丢失 - Cordova Plugin CodePush - updates lost after relaunching the iOS App iOS:如果没有 cordova-plugin-file-transfer,应用程序将无法打开 - iOS: app will not open without cordova-plugin-file-transfer 安装cordova-mfp-push插件后,为什么不能在真正的ios设备上运行cordova应用程序? - Why can I not run a cordova app on a real ios device, after the installation of the cordova-mfp-push plugin? Cordova iOS插件-无法构建应用 - cordova iOS plugin - app can not build Cordova + iOS应用程序开发中的设置工具插件 - Settings tool plugin in cordova +ios app development 为什么 sqlite 插件无法与 ios 上的 cordova 应用程序一起使用 - why is sqlite plugin not working with cordova app on ios
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM