简体   繁体   中英

Caching PHP POST data in HTML5 app cache from mobile device with no connectivity

This question may be a little generalised, but I'd like to get some ideas on how to go about this.

Basically I've developed a hybrid iOS app where the iOS end of it is simply a UIWebView with some extra bolt ons that get data from various parts of the UI webview and display them to the user in different ways.

The application allows you to update real time states of various things, so there is a drop down menu that has options like:

 Empty
 Full
 Unavailable

The problem is that in the environment that this is now being used in there is very patchy cellular connection and no wireless networking. So what I would like to do is for the web app to check wether or not there is connectivity and if there isn't to cache the data locally. I believe I can do this with the HTML5 app cache? And then when there is connectivity again I'd like it to check the cache file for new data and submit it.

Is this possible or do I need to look elsewhere? If it is possible, Does anybody have any advice or tips to help? Your help/advice is much appreciated.

EDIT:

Alternatively is there a way for me to grab AJAX POST data from within the UIWebView and then store it so I can submit it when the application finds connectivity again?

因此,从那以后,我就解决了如何从UIWebView中获取POST数据的问题,因此我现在应该能够将该数据存储在CoreData中,然后使用javascript执行一些目标C将数据从CoreData中发布到数据库中。

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