0

I have an application and I would like to block the exit of it to the people that doesn't know the application, how can i do it? I only found a function to block back button...

Thank you so much...

Alessandro Candon
  • 543
  • 2
  • 6
  • 21
  • Do you mean to disallow the user from exiting the application? Because I highly doubt that such a thing is allowed by any operating system. – Dexter Mar 30 '16 at 19:13
  • Yes... Because i have a ionic APK used in a kiosk for a client of a store so I would like to block the exit of it... Isn't possibile? – Alessandro Candon Mar 31 '16 at 08:31

1 Answers1

1

The closest thing I could find is called task locking or screen pinning on Android. It is only supported on Android Lollipop (5.0) or higher. The documentation has the following to say about this feature:

Android 5.0 introduces a new screen pinning API that lets you temporarily restrict users from leaving your task or being interrupted by notifications. This could be used, for example, if you are developing an education app to support high stakes assessment requirements on Android, or a single-purpose or kiosk application. Once your app activates screen pinning, users cannot see notifications, access other apps, or return to the home screen, until your app exits the mode.

There are some other questions asked regarding task locking, which you can find here and here.

I have been able to find a Cordova plugin for this here, however it doesn't seem to be very active at this moment in time.

Unfortunately, I don't think that this will actually solve your problem. From what I have been able (or unable) to find, this just doesn't seem to be possible. I think it is similar to closing an app on iOS with code, it is simply not allowed by the developers of the operating system.

Dexter
  • 2,462
  • 4
  • 24
  • 28