1.0.1 • Published 2 years ago
cordova-plugin-dnd-mode v1.0.1
cordova-plugin-dnd-mode
This plugin allows check status and enable/disable the Do Not Disturb Mode.
Installation
Install plugin from npm:
npm i cordova-plugin-dnd-modeOr install the latest master version from GitHub:
cordova plugin add https://github.com/cesarcervantesb/cordova-plugin-dnd-modeSupported Platforms
- Android
Usage
The plugin creates the object cordova.plugins.dndMode and is accessible after the deviceready event has been fired.
document.addEventListener('deviceready', function () {
// cordova.plugins.dndMode is now available
}, false);Available methods
requestPermission- Request permission 'ACCESS_NOTIFICATION_POLICY' for Android platform.
dndMode.requestPermission()toggleDNDMode- toggle Do Not Disturb Mode. (enable | disable)
dndMode.toggleDNDMode()checkDNDMode- Get all info related to Do Not Disturb Mode.
dndMode.checkDNDMode()return a JSONObject containing the Do Not Disturb Mode information:
enabled- BooleanpermissionGranted- Boolean