npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-plugin-android-mdm

v0.2.0

Published

Cordova plugin to retrieve configuration from Android for Work as JSON

Readme

Cordova Plugin for Configuration from Android for Work

How to Use

Create an XML file at <project root>/resources/android/app_restrictions.xml which describes the restrictions you want to make available in your app. See the XML definition here.

NOTE: This plugin does not yet come with a way to create resource strings for the description attribute and use of a string resource for the description attribute is compulsory if used. So, you can not yet use the description attribute unless you figure out your own way of adding entries to platform/android/res/xml/strings.xml for you to reference.

app_restrictions.xml is automatically copied into the corresponding directory under platform after a Cordova prepare. If you want to keep the file elsewhere, ensure app_restrictions.xml is copied to platform/android/app/src/main/res/xml/ or at least exists before attempting to compile. platform/android/app/src/main/res/xml/app_restrictions.xml may be deleted when preparing. This plugin will automatically add the required reference to app_restrictions.xml in AndroidManifest.xml.

In your Cordova JS you can use the below functions to get your application restrictions.

Supported Restriction Types

String, Integer, Boolean, Null(Hidden String)

TODO: Bundle, Bundle Array, Choice, Multi Select

Available functions:

addRestrictionListener(function callback)

Not yet tested

Set a callback function to be called whenever the application receives the ACTION_APPLICATION_RESTRICTIONS_CHANGED intent. This should be set in your onDeviceReady function or similar. Listening for this intent is paused when onPause occurs and resumed when onResume occurs within native code. The callback will receive the new restrictions as a parameter, identical to the getAppRestrictions response.

getAppRestrictions(function callback)

Get a JSONObject of the keys/values for all of the restrictions that have been set the Device Policy Controller/EMM/MDM/Whatever. This function should be used when your application starts and resumes to check for changes to restrictions. The restrictionListener callback will not be called when the application is paused. Will return an empty object if the app has not had any restrictions set. The JSONObject will be passed to the callback function as a parameter.

getManifestRestrictions(function callback)

Get a JSONObject which describes each of the restriction entries from app_restrictions.xml, indexed by key. Each restriction has key, title, type, description and defaultValue.

Versions

Use version 0.0.1 for cordova-android < 7. The only change for 0.2.0 is the location of the AndroidManifest.xml and support for cordova-android 7 and up.

References

AppConfig Community

Set up Managed Configurations | Andoid Developers

RestrictionsManager | Android Developers