MewsSystems / mews-flutter

Flutter and Dart open-source packages maintained by Mews.
63 stars 27 forks source link

Disable the toast saying "The screen is pinned" #290

Closed TobiasDuelli closed 1 year ago

TobiasDuelli commented 1 year ago

Would be nice to have the possibility to disable the toast with the instruction on how to stop the kiosk mode.

ookami-kb commented 1 year ago

This is out of scope for the library, but you can easily do it by subscribing to the mode:

watchKioskMode().listen((mode) {
 if (mode == KioskMode.enabled) {
   // display toast
 }
});
aososam commented 1 year ago

@ookami-kb I agree this would be a really useful feature.

I understand In order to avoid showing the message "App is pinned" I have to: 1) Make my app the device owner (by running a line of code from the terminal) 2) WhiteList the app to use LockTask (devicePolicyManager.setLockTaskPackages)

However, to do the second one it seems that I need to create a Method channel but it could be added to this library. I am following the example from this page: https://medium.com/@vimalp015/making-your-android-device-to-be-a-kiosk-7ea3cba1b40c

aososam commented 1 year ago

Now I understand why it cannot be part of the package. the app needs to have a custom DeviceAdminReceiver class. 👍🏻

fabioselau077 commented 10 months ago

Now I understand why it cannot be part of the package. the app needs to have a custom DeviceAdminReceiver class. 👍🏻

Did you find any solution for this?