1

Here's my question, i have a UIWebview app that i have deployed for our companies sales force, problem i am having is the following, i use simple cart js and jotform to send the sales tickets back to the office, i have it setup so the app doesn't go to background on exit however items in the cart still remain when they reopen app, so i need to know if there is anyway to make the app revert to default everytime it opens or delete that stored information when opened?

Thanks In Advance

Léo Natan
  • 56,823
  • 9
  • 150
  • 195

1 Answers1

1

To clear your SimpleCart cart call this:

[myWebView stringByEvaluatingJavaScriptFromString:"simpleCart.empty();"];

Documentation:

lootsch
  • 1,867
  • 13
  • 21
  • called it but cart still appears when app is re-opened – Angel Garcia Apr 04 '14 at 17:49
  • is there any code or command that will restore the app to its original settings (as in when its first installed) every time its closed? – Angel Garcia Apr 04 '14 at 17:55
  • normally, you get this with `UIApplicationExitsOnSuspend` set to `YES` – lootsch Apr 04 '14 at 18:00
  • i am using the exitsonsuspend and it is working but on reopening the app it starts at the initial "welcome" page but the items in the cart from the previous order are still in the cart which is where i am stuck – Angel Garcia Apr 04 '14 at 18:05
  • try to delete the local webview data like this: http://stackoverflow.com/a/13223746/2115477 – lootsch Apr 04 '14 at 18:30