Page 1 of 1

How to use Cordova plugins for compiled apps?

Posted: Wed Aug 29, 2018 3:25 am
by otlik
Hello all!

Now I build a kiosk app to android devices, I want to hide navbar (statusbar hided succesfully with config.xml preference).

I add this plugin now to config.xml, but I dont know how can i activate it:
https://www.npmjs.com/package/cordova-plugin-fullscreen

Where should I paste the code like this:
AndroidFullScreen.immersiveMode(successFunction, errorFunction);

I also try to find solution for the screen no sleep. Can anyone write me a good solution for this?

Thanks!

Peter

Re: How to use Cordova plugins for compiled apps?

Posted: Wed Aug 29, 2018 4:13 am
by luishp
Try to add your code in App Events->StartUp:

Code: Select all

BeginJS
AndroidFullScreen.immersiveMode(successFunction, errorFunction);
EndJS
Good luck!

Re: How to use Cordova plugins for compiled apps?

Posted: Wed Aug 29, 2018 4:35 am
by otlik
Thanks your rapid answer, but It isn't work :( I try it with inserted plugin (phonegap builder insert plugin js to plugins folder automatically) and also tried it to load the js directly to the neoappbuilder. No luck.


Console:
jQuery.Deferred exception: 'AndroidFullScreen' not defined
'AndroidFullScreen' not defined (jquery.min.js, 2)

Re: How to use Cordova plugins for compiled apps?

Posted: Wed Aug 29, 2018 4:50 am
by luishp
Sorry, I do not have much experience with Cordova plugins but, at first sight, it seems the appropiate JavaScript code has not been loaded.