cordova-plugin-locktask
cordova-plugin-locktask copied to clipboard
[Request] Add "isDeviceOwner" method
I'd like the ability to check whether or not my app is the Device Owner from this API. Would you be able to implement a new action for that?
Couldn't hurt to also have a "isInLockTaskMode" method as well.
In the spirit of matching the API maybe exposing isDeviceOwnerApp would work. If you have the time to implement this and submit a pull request I would gladly add it in.
I think isInLockTaskMode
is something that could just be set as needed from the startLockTask
callback.
please add this method. I am current using this plugin but cant startlock with admin provision :( i am dying to work this out. i need this because my app is for company use(kiosk mode). i already allowed my app in device admin but when i try to startlock.. theres a prompt still. i already add classname window.plugins.locktask.startLockTask('','',subclassname);
but i cant make it work. please help!
btw. i added the subclass inside io/cordova/appname
where mainactivity located. so i had 2 .java
files the mainactivity
and appnameAppAdmin.java
. Because i cant see the folder com/appname etc.
appnameAppAdmin.java code is
package io.cordova.appname;
import android.app.admin.DeviceAdminReceiver;
public class appnameAppAdmin extends DeviceAdminReceiver {
// Some code here if you want but not necessary
}
and then added in manifest file
<receiver android:label="@string/app_name" android:name="appnameAppAdmin" android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data android:name="android.app.device_admin" android:resource="@xml/device_admin" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>
Did i miss something?