cordova-plugin-locktask icon indicating copy to clipboard operation
cordova-plugin-locktask copied to clipboard

[Request] Add "isDeviceOwner" method

Open adamgoose opened this issue 7 years ago • 4 comments

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?

adamgoose avatar Aug 30 '17 21:08 adamgoose

Couldn't hurt to also have a "isInLockTaskMode" method as well.

adamgoose avatar Aug 30 '17 22:08 adamgoose

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.

oddmouse avatar Sep 12 '17 17:09 oddmouse

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!

jaycee04 avatar Oct 06 '17 08:10 jaycee04

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?

jaycee04 avatar Oct 06 '17 08:10 jaycee04