https://github.com/kolbasa/cordova-plugin-buttons
This plugin allows you to listen to the hardware buttons on Android devices.
https://github.com/kolbasa/cordova-plugin-buttons
buttons cordova hardware listener
Last synced: 8 months ago
JSON representation
This plugin allows you to listen to the hardware buttons on Android devices.
- Host: GitHub
- URL: https://github.com/kolbasa/cordova-plugin-buttons
- Owner: kolbasa
- License: mit
- Created: 2022-02-05T13:50:43.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-13T17:50:30.000Z (over 4 years ago)
- Last Synced: 2025-01-20T21:17:31.583Z (over 1 year ago)
- Topics: buttons, cordova, hardware, listener
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Cordova Buttons Plugin
=========================
This plugin allows you to listen to the hardware buttons on Android devices.
# Installation
### Cordova
cordova plugin add cordova-plugin-buttons
### Ionic + Cordova
ionic cordova plugin add cordova-plugin-buttons
### Capacitor
npm install cordova-plugin-buttons
# API
### subscribe()
```js
Buttons
.subscribe(function(button) {
// your callback
})
.then(function () {
// started
})
.catch(function (err) {
// something broke
});
```
### unsubscribe()
```js
Buttons
.unsubscribe()
.then(function () {
// stopped
})
.catch(function (err) {
// something broke
});
```