1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    4
    Vote Rating
    1
    rHodges is on a distinguished road

      1  

    Default iPad Home Screen App refreshes on every open

    iPad Home Screen App refreshes on every open


    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/201...e-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/6...-on-every-open

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      -1  

    Default


    This is how iOS handles it.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext Premium Member
    Join Date
    Jan 2010
    Posts
    31
    Vote Rating
    0
    ydi is on a distinguished road

      0  

    Default solution??

    solution??


    And what is the solution??

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This is how iOS handles it, there is no control over this.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Ext Premium Member
    Join Date
    Jan 2010
    Posts
    31
    Vote Rating
    0
    ydi is on a distinguished road

      0  

    Default Thank's

    Thank's


    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?

  6. #6
    Ext Premium Member
    Join Date
    Jan 2010
    Posts
    31
    Vote Rating
    0
    ydi is on a distinguished road

      0  

    Default the same pb with sencha touch 2

    the same pb with sencha touch 2


    the same pb with sencha touch 2

  7. #7
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,522
    Vote Rating
    814
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  8. #8
    Ext Premium Member
    Join Date
    Jan 2010
    Posts
    31
    Vote Rating
    0
    ydi is on a distinguished road

      0  

    Default Solution

    Solution


    I found a solution for my case, for opening my App in Safari
    in applictaion launch function (in app.js file)
    Code:
    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...

  9. #9
    Ext JS Premium Member
    Join Date
    Nov 2009
    Location
    San Diego, CA
    Posts
    158
    Vote Rating
    0
    locutusUT is on a distinguished road

      0  

    Default


    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.