I'm attempting to write a cordova plugin that depends on another plugin. My plugin specifies a dependency like so:
<dependency id="fr.pierrickrouxel.cordova.plugin.iCloudKV" url="https://github.com/pierrickrouxel/phonegap-icloudkv-plugin.git" />
Then, in my .js component, I attempt to reference the 'iCloudKV' javascript variable that is exported by the dependent plugin, but I get this error:
ReferenceError: Can't find variable: iCloudKV, http://172.20.1.101:8101/cordova.js, Line: 71
Is there an approved way to reference javascript in dependent plugins? Is the "module.export" from the iCloudKV plugin importable in some way with a require() or something? I've tried the obvious things, but nothing seems to match.
The issue is that I needed to require() the javascript portion of the iCloudCV plugin. The module that is exported by cordova is prefixed by the plugin's id, so the full code to include the "iCloudCV" variable in the "fr.pierrickrouxel.cordova.plugin.iCloudKV" plugin is:
var iCloudKV = require("fr.pierrickrouxel.cordova.plugin.iCloudKV.iCloudKV");
...and then I could reference it properly.