Closed odai-alali closed 6 years ago
Hi, this change is already included in experimentail branch "mainactivity" - see https://github.com/hkalina/cordova-plugin-kiosk/issues/27 This is not merged in upstream yet, because of problem reported by @narigondelsiglo. Please test this branch and let us know if it works ok - if it will work ok for you, I will merge it and also modification requested in this PR will be in master.
OK, I'll check it tomorrow. But I noticed that you deleted HomeActivity.java. Isn't needed as the comment in plugin.xml states?
activity to use as launcher - because Cordova app is failing if started while boot
That is related to very old Android versions. But please test and let us know if device reboot correctly while kiosk app is set as launcher activity.
cordova-android:7.0 android device 5.0
So... I installed the mainactivity
branch to check it out.
The kiosk mode runs without problems. On reboot the home screen chooser appears with my app in the list waiting for the user to choose (setting the app as the default user screen should eliminate this).
But I noticed weird behavior, The back button is not blocked completely. it triggers the history back in my web application but exiting the application with back button in prevented though. Is that an expected behavior?
Hope this helps.
@odai-alali to allow Back button (or volume buttons for example) use KioskPlugin.setAllowedKeys([ keyCode ]);
call.
Thanks for confirmation, will merge mainactivity into master now.
Just note there is also build failure in CI for this PR:
node:5612) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Unable to graft xml at selector "/manifest/application/activity[@android:name='MainActivity']" from "/home/travis/build/hkalina/cordova-plugin-kiosk/hello/platforms/android/app/src/main/AndroidManifest.xml" during config install
Thanks! Everything is in master now.
KioskActivity should overwrite the MainActivity configuration in manifest file, otherwise two the built application will contain two cordova activities and only the KioskActivity will be visible.
This error can be seen in the device inspect in Chrome: