Friend, you have a very complicated problem here. Almost no Cordova plugin is only in Javascript, they have a part encoded in Java or other languages depending on each platform besides the fact that they need permissions for each action.
For example in the mentioned Vibration plugin we realized that inside the folder SRC
there are several codes that should be added to the application project. They cannot be retrieved from a server.
Another problem that can occur easily is hosting different versions of files JS
, may cause future problems.
However...
As Cordova is a relatively new technology, which has no support at all is still common to find users and developers thinking about alternatives and solutions to problems like this.
I don’t know how you intend to incorporate this plugin into your project and when it should be embedded. But I suppose you might want to use it in just one specific case. For example request the plugin only when activating notifications or something similar.
If it is something of this style I recommend that you implement all the functions in your application, but all the functions that you use and that you can use, do this create events
in your app to trigger these functions. This way you can make a communication from your Web server using Javascript requests, but sending events. And yes, the application should be larger, but everything should work without problems.
Thank you very much for the answer, but I solved the problem using an iframe in my html. vlw
– AndersonSouza
@Anderson, here at Stack we say "thank you" by voting positively ;) And publishing your own solution is also encouraged. Thanks!
– brasofilo
@Brasofilo, I thought that I should vote positively only those responses that would be useful for the solution of my problem, so I did not vote positively. Should I still vote? And in my comment I informed how to solve the problem, maybe I missed a little more detail my solution, but still thanks for the tips. flw
– AndersonSouza
@Anderson, well, I also vote when I see that there has been effort on the part of the person and brings some new information. But, sure, the decision is all yours... I don’t want to force any bar. Greetings!
– brasofilo