maanse — 2012-07-19T15:29:26-04:00 — #1
I wasn't sure where to post this or if anyone would actually be able to help but here goes anyway....
basically, ive made a web app which is just a glorified web form - user fills in the fields then presses the submit button, the data is then passed to a web server for processing in the appropriate manner. The problem i have is that some times when i try to submit the form i may be out of signal but the app 'submits' anyway. The data then doesn't get passed to the web server.
What i would like if possible is:
a) Check for a data connection before submitting the form.
b) Store the data locally (iphone) for re-submit later on when in signal.
Could anyone suggest any ways of going about doing these 2 things please?
Thanks in advance.
fizixrichard — 2012-07-20T09:28:35-04:00 — #2
Just to deviate slightly, with a native app you would listen for a success response when you post something to the server - so the server talks to the app; if there is no server response then you know the server is unavailable. You wouldn't just check for a data connection to be live as that can be unreliable; you need a success response.
You need to check that the transfer can and has been made. Remember if someone is on the move they could have a connection but it could be so poor that it is unreliable. In which case it might make sense to store the data.
With saving the data, with native apps and web apps you can access local storage; using HTML 5: http://paperkilledrock.com/2010/05/html5-localstorage-part-one/
maanse — 2012-07-20T11:07:20-04:00 — #3
Thanks again for the help tho.