简体   繁体   中英

iOS HTML5 FileSystem API alternative

I have an application built that utilizes the HTML5 FilesSystem API, but it only works for Chrome.

Does anyone know of an existing plugin or a technique for replicating this functionality in iOS?

The catch is that I am rendering "mini-sites" for offline use. So I would need to be able to:

  • Download the files for the micro-site
  • Store them locally
  • Access them later. Right now, I'm using an iframe to render the page

My solution (right now) is to do the following.

  1. Because I am caching microsite files that I am pulling from a 3rd party, I set up a folder on a webserver and built out a PHP-based "caching" service that routinely compares the content I have stored on the 3rd part site to the same content stored locally to my server. It updates the content where necessary.
  2. The app, when it is run from iOS, will asynchronously load each of the microsites in an iframe (create a frame of size 1 x 1px with the appropriate src). The iframe self-destructs after loading is completed.
  3. Step 2 allows my service worker to cache all of the micro-sites locally, along with the main site.
  4. I have other code in place to keep the local iOS cache "fresh".

This works, but it is nowhere near as ideal as the Chrome File System API, so any alternative suggestions would be great!

Thanks, Wayne

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM