PDA

View Full Version : iPad Home Screen App refreshes on every open



rHodges
14 Jul 2011, 4:48 PM
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?


FFR: Solutions may have been posted on Stack Overflow --
http://stackoverflow.com/questions/6686654/ipad-home-screen-app-refreshes-on-every-open

mitchellsimoens
15 Jul 2011, 6:41 AM
This is how iOS handles it.

ydi
22 Aug 2012, 6:42 AM
And what is the solution??

mitchellsimoens
22 Aug 2012, 6:57 AM
This is how iOS handles it, there is no control over this.

ydi
22 Aug 2012, 7:02 AM
Thank you for response, but when I add another website like (gmail ...) in my home screen, the app is launched in safari and I did not connect every time I open gmail.
Why sencha (from home screen) is not opened in safari with navigation bar?

ydi
22 Aug 2012, 7:03 AM
the same pb with sencha touch 2

mitchellsimoens
22 Aug 2012, 7:20 AM
If you are within Safari and add the site to Homescreen and then open from the shortcut now on your Homescreen, it's not opening in Safari at all anymore

ydi
23 Aug 2012, 7:47 AM
I found a solution for my case, for opening my App in Safari
in applictaion launch function (in app.js file)


launch: function() {
Ext.fly('appLoadingIndicator').destroy();
//
...
//

var removeElementByName = function (elName) {
var appleEls = document.getElementsByName (elName);
var l = appleEls.length;
for (i = 0; i < l; i++) {
var el = appleEls [0];
Ext.removeNode (el);
}
};
removeElementByName ('apple-mobile-web-app-capable');
removeElementByName ('apple-touch-fullscreen');
},




My app is opened in Safari, so I did not connect to my account each time I open my app...

locutusUT
20 Mar 2013, 1:49 PM
I'm not sure I follow how that's a solution if you're opening your app in Safari. What if you open your app off the homescreen? Also, where did you get the element ID for the Ext.fly argument?

Since this is an issue iOS homescreen apps, it's causing a reauthentication event for me causing the user to have to log in everytime. In Safari, it doesn't do that.