0

I have one app based in Sencha Touch, and I need to compare in between different versions, I am looking in the "app.json" created after the production build with Sencha CMD I have a hash automatically generated, How to get this parameter and to compare with the newest?

At the moment the code is:

{
 "id": "0b56f51f-84f8-4b6b-aabc-f7c1e307b15a",
 "js": [
{
  "path": "app.js",
  "update": "delta",
  "version": "db540a8b0c86588f8096f081b1ede1cc77b8a3bf"
}],
"css": [
{
  "path": "resources/css/cupertino.css",
  "update": "delta",
  "theme": "Cupertino",
  "version": "82920e6412f82097ae5877f0096612befd59a8af"
}
]}

Thanks!

inane
  • 626
  • 10
  • 26
  • What are you trying to achieve by comparing the versions? That hash is typically used for delta file updates if i recall – mindparse Feb 04 '15 at 14:49
  • I suppose the hash changes each time you make a production build, (right?) I need to compare in between hashes for example and detect a new version.. Is it a good way? – inane Feb 04 '15 at 17:16
  • Those hash values are controlled and generated by Sencha CMD during the build procedure. Why do you need to detect version changes on the web server, what will this allow you to do? – mindparse Feb 04 '15 at 17:18
  • I don't have realtime notifications and I need to notify to the users a new version is available.. For this reason I guess a correct way to inform – inane Feb 04 '15 at 17:22

1 Answers1

0

Well as I'm sure you are already aware, if you update a version of a native app and deploy to a store (AppStore\Google Play) users with that app already installed will get a notification on their device telling them a new version is available to download.

With a web deployment of a Sencha Touch application I would suggest you add a version string variable to your app.js, so say in your launch function:

launch: function() {
    version: '1.0';
}

You could then save this version string in local storage when the user first visits the application and then compare the saved value to the version string in the app on their next revisits, if different then you know the user hasn't seen this version before and you can notify them accordingly (release notes, etc).

Is this the kind of thing you are thinking?

mindparse
  • 6,115
  • 27
  • 90
  • 191
  • Thanks for your response..Yes.. at the moment I am saving the version in local storage, from the server side send a variable with the value.. but sometimes the behavior is not correct and save a cached version.. I dont know why.. but I have listened app.json file is the best way but I don't find documentation – inane Feb 04 '15 at 17:36