iPad Home Screen App refreshes on every open
Asked Answered
C

1

16

I'm writing a web app for the iPad using HTML5 and SenchaTouch. The app uses cache manifest to function offline. Once it has been added in the home screen and opened without Safari, it will refresh itself every time it is opened, even if just navigating to the home screen and back. The desired behavior is to leave the app, do something else, and then come back to the app with everything untouched.

An example of a similar app that displays the same (undesired) behavior can be found here: http://ignitedmediadesign.com/WebApp/index.html

I've read that using a cache manifest should have solved this problem on iPhone ( http://www.stevesouders.com/blog/2011/06/28/lack-of-caching-for-iphone-home-screen-apps/ ), but doesn't seem to have done the trick for either iPhone or iPad.

Is there another way to fix this? Is there some secret to cache manifest files that stops this that I may have missed?

Conventionality answered 13/7, 2011 at 22:54 Comment(3)
+1 I have the same problem. I haven't been able to find any solution. :-(Druci
@Gunder I'm getting similar feedback on the Sencha forums saying that iOS will not handle homescreen apps any other way, but feel free to watch for responses hereConventionality
See my answer here: https://mcmap.net/q/281493/-iphone-quot-bookmark-to-homescreen-quot-removes-cookies-and-sessionChristadelphian
B
7

I'm under the impression this is simply the nature of the "home screen" web apps that operate outside of normal Safari. I have an app that operates just fine in Safari with some minimal state saving, but the blasted non-Safari version refreshes every time. EDIT: Even the showcased O’Reilly example that uses a cache manifest reloads every time when added to the home screen.

You may want to look into creating "routes" (URL fragments) that point to a controller/action pair. Look into the MVC PhoneGap example (If not using PhoneGap, you can scroll past all of that stuff and implement your own data model and store). Also see this Sencha Touch MVC tutorial.

Also, most of the rendered sencha touch components seem to maintain state between changes of the active item. For example. I have a main TabPanel that contains all sub panels. When switching between tabs on the main TabPanel's TabBar, each sub panel maintains its rendering, unless I've set a listener or controller action to do otherwise.

Hope this helps.

Bartolomeo answered 18/7, 2011 at 15:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.