I’m trying to install the a plugin but I can’t seem to get the javascript to load
The plugin that I’m trying to load is https://github.com/songz/cordova-plugin-opentok
I tried installing the plugin as such
$ cd myIonicProjectFolder
$ cordova plugin add https://github.com/songz/cordova-plugin-opentok/
Afterwards, I tried adding the the js file in index.html
...
<script src="cordova.js"></script>
<script src="opentok.js"></script>
However, when I tried running it using the ionic serve
or ionic emulate ios
, I get this error that the javascript is not found.
But, when I looked in the plugin folder, I do see it there /plugins/com.tokbox.cordova.opentok/www/opentok.js
Below is the tree structure
|____com.tokbox.cordova.opentok
| |____Gruntfile.js
| |____LICENSE
| |____README.md
| |____docs
| | |____...
| |____example
| | |____...
| |____package.json
| |____plugin.xml
| |____scripts
| | |____...
| |____src
| | |____...
| |____www
| | |____opentok.js
Update 1
I’m noticed that when installing other plugins (such as SQLitePlugin), it is not required to include the extra js. So, I also tried updating /plugins/ios.json
to include OpenTokPlugin, but still couldn’t get it to load. I noticed that my cordova_plugins.js
file is not autoloading OpenTokPlugin
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
{
"file": "plugins/com.ionic.keyboard/www/keyboard.js",
"id": "com.ionic.keyboard.keyboard",
"clobbers": [
"cordova.plugins.Keyboard"
]
},
{
"file": "plugins/cordova-plugin-console/www/console-via-logger.js",
"id": "cordova-plugin-console.console",
"clobbers": [
"console"
]
},
{
"file": "plugins/cordova-plugin-console/www/logger.js",
"id": "cordova-plugin-console.logger",
"clobbers": [
"cordova.logger"
]
},
{
"file": "plugins/cordova-plugin-device/www/device.js",
"id": "cordova-plugin-device.device",
"clobbers": [
"device"
]
},
{
"file": "plugins/cordova-plugin-splashscreen/www/splashscreen.js",
"id": "cordova-plugin-splashscreen.SplashScreen",
"clobbers": [
"navigator.splashscreen"
]
},
{
"file": "plugins/cordova-sqlite-common/www/SQLitePlugin.js",
"id": "cordova-sqlite-common.SQLitePlugin",
"clobbers": [
"SQLitePlugin"
]
}
];
module.exports.metadata =
// TOP OF METADATA
{
"com.ionic.keyboard": "1.0.4",
"cordova-plugin-console": "1.0.0",
"cordova-plugin-device": "1.0.0",
"cordova-plugin-splashscreen": "2.0.0",
"cordova-plugin-whitelist": "1.0.0",
"cordova-sqlite-common": "0.7.0-dev",
"com.tokbox.cordova.opentok": "1.0.3"
}
// BOTTOM OF METADATA
});
Please advice,
Thanks!
Justin