I saw in the docs that Volt support hook events with Cordova? It says it can support .js, and .bat file types. I attempted a simple .bat file but I’m not sure of the current path, and folder structure during the Cordova build. I’m not sure what the “code” parameter is.
Can someone shed some light? Basically I want to:
“cordova plugin remove”
“cordova plugin add admob DROID_ID IOS_ID”
Sample Code: I’ve been trying.
Config.xml
<hook type="before_plugin_install" src="scripts/install.js admob-plus-cordova my-adroid-id my-ios-id" />
<plugin name="admob-plus-cordova" source="npm" />
install.js
module.exports = function(ctx) {
var plugin = process.argv[1] || ‘’;
var droid_id = process.argv[2] || ‘’;
var ios_id = process.argv[3] || ‘’;
if (ctx.cmdLine.indexOf(plugin) > -1) {
ctx.cmdLine += " --save --variable APP_ID_ANDROID=" + droid_id + " --variable APP_ID_IOS=" + ios_id";
return true;
}
return false;
};
We do support hooks but this shouldn’t be necessary. Please see your other thread for details.