Am I able to use an external Js resource in Sencha Native app?
REQUIRED INFORMATION Architect Build tested:
I've created a very simple native app using Sencha Architect/Sencha Touch 2.1. I added a JS Resource. The JS file only declares a global variable. I find that I can access the variable in the JS resource if I bring up the app in a browser. If I create a native app and try to bring up the variable value (through a message box or something similar), I find that the variable is inaccessible. Is it possible to access an external JS resource code in a native app?
Steps to reproduce the problem:
Create a simple application with a JS Resource that contains a global variable with a string value.
Use something like a message box to display the variable value.
Create a native app and try the application in the iOS simulator (or on your iPad or iPhone).
Be sure that the index.html file that gets created when you package has been updated from the app.html. If you add the js resource after Architect made a copy of the app.html > index.html it will not again update it. This is because we wouldn't want you to lose any customizations.
You are correct. The message makes sense now. Unfortunately, the terminal window that gives the updates of the build usually covers the message and the message goes away too quickly. Also, by the time the message comes up, isn't it "too late"? Meaning the build has already used the out of date index.html?
I would suggest using the "Sencha Cmd Setup" dialog in Sencha Architect to improve the workflow for recognizing and needing to update the index.html that is generated. At the very least, putting the warning on the dialog would notify the user prior to the user hitting the "Simulate" or "Build" buttons. Optionally, you can give us a button to "regenerate" the index.html (and obviously overwrite the user's changes). Another idea is to give us a way to hand edit the index.html file from this dialog (without needing to go to some other editor).