I have come up with a solution, but I am still open to any newer / better ideas.
My current solution is as follows:
Create app /
util / config.js:
Code:
Ext.define('YOURAPPNAME.util.Config', {
singleton : true,
config : {
io: {
appId: "YOUR ID",
appSecret: "YOUR SECRET"
}
}
});
In your application 'Requires' add: YOURAPPNAME.util.Config
This makes your app load in a utility file which runs before the app is shown, loading in any configuration you would like to include. The config.js file is not picked up by architect, you must manage it manually using a text editor - this means architect and your custom code won't cross paths, and you don't have to worry about Architect overwriting any manual edits you make outside of the IDE.
Unfortunately the above doesn't completely work - despite setting the values hardcoded in the config.js file, the app sees them as null values when I query them. Therefore on app Launch I have to add:
Code:
YOURAPPNAME.util.Config.setIo({appId: "SOME VALUE",appSecret: "SOME VALUE"});
Then if I want to access my appSecret for example, anywhere in the app, I simply call:
Code:
var ioconfig = ADPro.util.Config.getIo();
secret = ioconfig.appSecret;
If anybody knows how to get around the null values problem (to eliminate having to setIo on launch), it would be much appreciated.
If not, I hope this helps somebody out there.