Android PhoneGap plugins not loading

I am trying to install and use the ChildBrowser plugin https://github.com/phonegap/phonegap-plugins/tree/master/Android/ChildBrowser for PhoneGap and the FaceBook plugin https://github.com/phonegap/phonegap-plugins/tree/master / Android / ChildBrowser . In both cases, I ran into the same problem that calling Javascript to call plugin methods would not work. Debug output shows:

TypeError: The result of the expression 'window.plugins' [undefined] is not an object.

Is there something I can lose to enable plugins in PhoneGap?

+4
source share
2 answers

Have you included the javascript file in your index.html? Make sure the javascript file has this -

PhoneGap.addConstructor(function() { PhoneGap.addPlugin("childBrowser", new ChildBrowser()); }); 
+1
source

https://github.com/phonegap/phonegap-plugins/issues/697 says:

"The addPlugin / addConstructor methods have been reset to 2.0.0. Take a look at the ChildBrowser, TTS or VideoPlayer plugin to learn how to change js code.

0
source

Source: https://habr.com/ru/post/1344698/


All Articles