thaarok / cordova-plugin-kiosk

Cordova plugin to use Cordova application "in kiosk mode" and as Android launcher
Apache License 2.0
142 stars 101 forks source link

Kiosk Installation to IONIC 3 #79

Open webspecialist opened 5 years ago

webspecialist commented 5 years ago

I want to disable the back, the home, the right button and if it is possible the button which closes the device. Someone in stackOverFlow recommend this plugin for me.

First of all I get this error when I am trying to install this in IONIC 3:

Failed to fetch plugin https://github.com/hkalina/cordova-plugin-kiosk.git via registry. Probably this is either a connection problem, or plugin spec is incorrect.

My problem is that I can't make it work. I tried to put: 1) window["Kiosk"].isInKiosk((isInKiosk)=>{ this.imer = isInKiosk; }).catch(error=>this.imer = 'no'); 2) cordova.plugins.Kiosk.isInKiosk((isInKiosk)=>{ this.imer = isInKiosk; }); 3) declare let Kiosk:any and in constructor this: Kiosk.setKioskEnabled(true);

I think something I do wrong. How to install this in IONIC 3 from the beginning? Could you provide me all the details? Thank you in advance.

thaarok commented 5 years ago

Hi, please check README first: https://github.com/hkalina/cordova-plugin-kiosk/blob/master/README.md The app has to be set as device launcher in the device settings.

webspecialist commented 5 years ago

Hello, The first problem is that I can't install this plugin to IONIC 3. Failed to fetch plugin github.com/hkalina/cordova-plugin-kiosk.git via registry.

Ionic CLI : 5.2.3, Cordova 9.0.0 (cordova-lib@9.0.1) What can I do?

enzocandotti commented 5 years ago

Could you install it? This worked for me: ionic cordova plugin add https://github.com/hkalina/cordova-plugin-kiosk.git

Then go to your controller and add: declare let KioskPlugin: any;

and you'd be able to call its methods like : KioskPlugin.exitKiosk(); KioskPlugin.setKioskEnabled(true);

webspecialist commented 5 years ago

No I cannot install it in IONIC 3. It says failed to fetch plugin.

Did it work on IONIC 3 to you?