1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    6
    Vote Rating
    0
    blueskii68 is on a distinguished road

      0  

    Default Answered: When will run onUpdated function in app.js?

    Answered: When will run onUpdated function in app.js?


    Hi, Sencha Touch Team!

    I made Sencha Touch 2 MVC WebApp folders and files by Sencha SDK Tools.

    I don't understand when onUpdated function in app.js works.

    onUpdated: function() {
    Ext.Msg.confirm(
    "Application Update",
    "This application has just successfully been updated to the latest version. Reload now?",
    function() {
    window.location.reload();
    }
    );
    }

    Thanks.

  2. You should never change the 'id' value in app.json. An in-depth article on how micro-loaders in Touch 2 works is coming soon, so do keep an eye on our blog / newsletter updates.

    As a short explanation: 'onUpdated' is triggered after either, or both of the following cases happen:

    - Your application's HTML 5 manifest file (cache.manifest) changes. Read more on HTML 5 app cache if you're new to this feature. Since cache.manifest is generated automatically, it contains the checksum values of all managed assets. As you modify the content of index.html file or any other file listed in the 'appCache' config inside app.json, their checksum values change -> the content of cache.manifest changes.

    - You have changes in any of your JavaScript or CSS assets listed in the "js" and "css" config inside app.json. Similarly to cache.manifest, when you build your application for production, a production version of app.json is generated automatically. This file contains checksums for all assets. By comparing the latest checksum values with the ones locally stored inside Local Storage, the app knows exactly what file has changed, and pull down the delta for that item, then patch its local copy to make it identical to the latest one.

  3. #2
    Sencha User Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Answers
    24
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      0  

    Default


    It gets called when your local copy of the application has been updated after you deploy the new version on your production server, either via delta updates or HTML 5 manifest update. The web view needs to be reloaded for the user to see the changes taking place, hence the prompt simply notifies and gives the user the option whether or not he/she wants to reload right away, or wait till the next time the app is opened.
    Sencha Touch Lead Architect

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    6
    Vote Rating
    0
    blueskii68 is on a distinguished road

      0  

    Default Thank you for your kind reply.

    Thank you for your kind reply.


    I knew what onUpdated function is for. I'm so interested to find out really, when and how web view(chrom browser) is checking the production server's changes?
    Would you elaborate a bit on that? Please ...

    Thanks.

  5. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    6
    Vote Rating
    0
    blueskii68 is on a distinguished road

      0  

    Default I got onUpdated function is running

    I got onUpdated function is running


    Hi, Jacky Nguyen.

    I got onUpdated function is running when applicaiton's id is changed.
    Am I to understand that application'id include production's version?

    for example)
    "id": "02da3480-7043-11e1-9b78-0db0d128d299" --> "id":"com.my.app-1.0.0"

    Thanks.

  6. #5
    Sencha User Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Answers
    24
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      0  

    Default


    You should never change the 'id' value in app.json. An in-depth article on how micro-loaders in Touch 2 works is coming soon, so do keep an eye on our blog / newsletter updates.

    As a short explanation: 'onUpdated' is triggered after either, or both of the following cases happen:

    - Your application's HTML 5 manifest file (cache.manifest) changes. Read more on HTML 5 app cache if you're new to this feature. Since cache.manifest is generated automatically, it contains the checksum values of all managed assets. As you modify the content of index.html file or any other file listed in the 'appCache' config inside app.json, their checksum values change -> the content of cache.manifest changes.

    - You have changes in any of your JavaScript or CSS assets listed in the "js" and "css" config inside app.json. Similarly to cache.manifest, when you build your application for production, a production version of app.json is generated automatically. This file contains checksums for all assets. By comparing the latest checksum values with the ones locally stored inside Local Storage, the app knows exactly what file has changed, and pull down the delta for that item, then patch its local copy to make it identical to the latest one.
    Sencha Touch Lead Architect

  7. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    6
    Vote Rating
    0
    blueskii68 is on a distinguished road

      0  

    Default Thank you for your kind reply.

    Thank you for your kind reply.


    I knew exactly when onUpdated function is triggered, thanks to you.
    Have a good day!

  8. #7
    Sencha User
    Join Date
    Feb 2012
    Posts
    54
    Vote Rating
    0
    Rui Marinho is on a distinguished road

      0  

    Default


    How does this work, when we have native packing in our app ? the files are running local right ? how does it check it has changes on the server ?

  9. #8
    Sencha Premium Member intellix's Avatar
    Join Date
    Mar 2012
    Location
    UK + Malta
    Posts
    263
    Answers
    5
    Vote Rating
    18
    intellix will become famous soon enough

      0  

    Default


    I've not seen this dialog pop up in quite a while. Saw it happen once but never again after that. Using the sencha stuff to generate everything.

    Edit: sorry it seems my function name became onUpdate instead of onUpdated

  10. #9
    Sencha User
    Join Date
    Mar 2007
    Posts
    411
    Answers
    5
    Vote Rating
    17
    jweber will become famous soon enough

      0  

    Default


    Is it possible to delay loading the app until the update check is complete? It can be annoying to start working in the app, only to have the update alert appear.

    Or alternatively, is there a function/event that gets called when the update check is done, regardless of whether an update is required?

  11. #10
    Sencha User
    Join Date
    Apr 2013
    Posts
    2
    Vote Rating
    0
    ctys is on a distinguished road

      0  

    Default onUpdated not worked in native mode

    onUpdated not worked in native mode


    Quote Originally Posted by Rui Marinho View Post
    How does this work, when we have native packing in our app ? the files are running local right ? how does it check it has changes on the server ?
    What should I do if I want to use "onUpdated" to notify customs to download latest app?
    Or any other way instead.
    Thanks for any help.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi