Accessing settings in mobile-config.js

The ‘–settings’ option is a great way to setup different environments by creating various files like ‘settings-dev.json’, etc for each one. However, there seems to be no way to access these environments in the mobile-config file. Consequently, there seems to be no clean way to manage environment-specific variables for plugins like ‘com.phonegap.plugins.facebookconnect’.

Similar to this, my current workaround is to parse the command line args to get the environment-specific settings filename and set the variables accordingly. It works, but there’s duplication of those variables.

Would you guys be open to making the settings json available in the mobile-config file? Or maybe a subset of it (e.g. under a “cordova” key)?

2 Likes

See cordova-plugin-compile-time , which does the job for some properties. I am looking at how to get this similar behaviour for the web version as well. I need version and buildNumber.

There is an existing feature request for this: https://github.com/meteor/meteor/issues/4751.