Closed krishna711 closed 6 years ago
Hi, can you provide stacktrace or any debug info which would help to determine why has the app crashed?
I can but not sure how to generate stacktrace for ionic app. When app crash it closed and nothing shows up. If you have any idea let me know so you I can provide relevant info.
Run adb logcat
command (from platform-tools in android sdk) while the device is connected in usb debug mode. Try to catch the exception which will arrive in the log when the application crash.
https://developer.android.com/studio/command-line/logcat
Thank you. I will check exception via this method. I noticed another issue. In one device, back button does not lock. Only home button, and option button lock. Back button always open to use. Device run on Android 5.0. Please check this issue as well.
Attached logcat log during app crash. Device nexus, android 7.1.1 logcat.txt
Can you send your /data/anr/traces.txt mentioned in your logcat.txt?
Regarding the back button, open standalone issue and provide appropriate logcat output too please. (does "onKeyDown event: keyCode = ..." appear in the log?)
Here traces.txt file. I will open standalone issue for back button and send logcat separately. Thanks traces.txt
Did you find anything? Please update if possible. I can also send you apk file if needed. Also, I tried your demo app which works fine. The only difference I found is that demo app built in ionic version 1 while my app built on ionic 3. Other plugins list if that helps.
cordova-plugin-device 2.0.2 "Device" cordova-plugin-inappbrowser 3.0.0 "InAppBrowser" cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 1.1.19 "cordova-plugin-ionic-webview" cordova-plugin-kiosk 0.2 "Cordova Kiosk Mode" cordova-plugin-splashscreen 5.0.2 "Splashscreen" cordova-plugin-whitelist 1.3.3 "Whitelist"
Hi, sorry, provided logs has not give me any hint what could be the issue. If you can send reproducing app, it will be very helpful.
Yes, attached apk file. It is simple quiz app. Quiz logic is coded in typescript and jquery. Nothing changed or customised on ionic or plugin level. Thanks a lot for help.
It looks related to InAppBrowser: there is option hardwareback:
If you will not by able to fix it that way, as a workaround, you can implement custom back button handler in Ionic: https://ionicframework.com/docs/api/platform/Platform/#registerBackButtonAction
Thanks a lot.. It worked. Do you have any idea on disable option/recent history button as well?
Thanks
Kiosk plugin rely on fact its activity is only thing allowed on screen - when KioskActivity lost a focus, it kills all system dialogs. But InAppBrowser is non-system Dialog, which mean it is not killed, but when something tries to cover it (like recent apps menu), KioskActivity will not kill it as it has not focus already. Modified version of InAppBrowser plugin would be necessary. (Maybe could be provided as part of kiosk plugin directly...) Are you sure you need InAppBrowser? If the displayed web page is trusted, you can embed it in
I think you are misunderstanding inappbrowser plugin. This plugin is used to open url within app. Actual app running without inappbrowser plugin. It is only being used when click on link within app. I added below code in KioskActivity.java file to disable recent apps button. It actually bring back app on focus when all apps goes on pause state.
@Override
protected void onPause() {
super.onPause();
ActivityManager activityManager = (ActivityManager) getApplicationContext()
.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.moveTaskToFront(getTaskId(), 0);
}
The onPause() method of KioskActivity should be called when InAppBrowser dialog is shown - but the activity is already paused not when something covers the dialog, so it should not be called. Does it really works? Pull requests are welcome! ;)
Yes, it is working for me. Now i am not able to put back app. Without this code recent apps dialog appear and user able to put this app in background. With this code, recent apps dialog appear for fraction of second and app gets focus again.
Your pull request is welcome - it should be sufficient to press Edit button in the top of the file here on Github ;) Please mention this issue (as "resolves #53") in commit message - Thanks!
thanks for commision!
Hi, Plugin is work fine but there is flaw in it. Sometimes it crash when we use back button or any button. Back button not blocked on some device as well. App crash allow user to open other apps in the device.
It there any fix for this issue?