-
31 Jan 2013 3:05 AM #1
Can't insert a new app.json file to an AppStore app
Can't insert a new app.json file to an AppStore app
REQUIRED INFORMATION
Ext version tested:
sencha-touch-2.1
Description:
I am not sure that this can be defined as a bug, maybe it is the intended behavior...
I wasn't able to change the localStorage copy of the app.json of a native app. Therefor, delivering a new app.json file with each version only impacts new installs ,not version updates.
This settings gives developers no flexibility of changing the app.json file. (on my specific scenario I was also required remove app.js & app.css from local storage).
Possible fix:
Modifying the source code of touch/microloader/production.js:- Adding a single new line to getManifestStorageKey() function:
Code:function getManifestStorageKey(id) { documentUri = documentUri.replace('index.html', ''); // for some reason, the file name in localStorage was index.htmlapp.json, so this fixes that return id + '-' + documentUri + manifestFile; } - Adding a single-time procedure to Ext.blink(). The procedure resets all the localStorage entries that contains the ManifestStorageKey string:
Code:Ext.blink = function(manifest) { /* NEW ADDED CODE */ var mykey = 'JsonOverriden'; //define some unique key var JsonOverriden = retrieve(mykey); // retrieve(key) is basically: localStorage.getItem(key); var manifestStorageKey = getManifestStorageKey(manifest.id); if (!JsonOverriden){ var id = manifest.id; for (i in localStorage){ if (i.indexOf(id) != -1 ) localStorage.removeItem(i) } store(mykey, true); // save a flag (mykey) to localStorage, so this procedure runs only once documentLocation.reload(); return; } /* END OF ADDED CODE */ var manifestContent = retrieve(manifestStorageKey); writeMeta('viewport', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no'); writeMeta('apple-mobile-web-app-capable', 'yes'); writeMeta('apple-touch-fullscreen', 'yes'); if (manifestContent) { manifest = new Manifest(manifestContent); blinkOnDomReady(manifest); } else { requestXhr(manifestFile, function(content) { manifest = new Manifest(content); manifest.store(); blinkOnDomReady(manifest); }); } };
- Win 7
- Adding a single new line to getManifestStorageKey() function:
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote