Doubt when using the inappbrowser Cordova plugin

Asked

Viewed 524 times

1

I’m using the plugin inappbrowser so I can access from inside my webapp some pages that are on my server. So far so good, works perfectly, but I’m wanting to use another Ordova plugin inside those files that are on the server, the plugin "Vibration" but I’m not getting it because I don’t have cordova.js and even if I just take this javascript file there, it won’t be enough as this file uses many things.

Has anyone been there? knows how to solve this dependency?

1 answer

1

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

  • @Anderson, here at Stack we say "thank you" by voting positively ;) And publishing your own solution is also encouraged. Thanks!

  • @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

  • @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!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.