How to include script from cordova plugin?


#1

Hello!
I’m writing a mobile app where i need to use cordova plugin that must be included in script tag.


How can i do this? I tried to include it as said in documentation: script type=“text/javascript” charset=“utf-8” src="opentok.js"
But when project loads, it can’t find opentok.js. What path i need to specify for opentok.js?


#2

I think /opentok.js should work.


#3

Not working.

Is it possible to output all scripts provided by installed cordova plugins?


#4

You can find all assets in .meteor/local/cordova-build/platforms/(ios or android)/www. This is where opentok.js is copied to.

However, it turns out there is currently no way to load arbitrary scripts directly from the asset directory. This is a restriction of our current file serving and hot code push plugin. I’m working on a rewritten version of this plugin and will make sure to fix this. Thanks for bringing it to my attention!

For now, the only workaround I can think of would involve copying opentok.js to the plugins directory (which gets special treatment so files there are served).


#5

I used this workaround (copying file from .meteor/local…), but i thought, that it is a wrong way to do it.
So i’ll continue to use this workaround and wait for new version of plugin.
Thank you for clearing things up.

And thank you for all this cordova/mobile stuff in meteor 1.2, it is great!