Detect a wired or wireless (Bluetooth) headset, connected to you phone.
HeadsetDetection is compatible with Cordova Plugman and the PhoneGap and Cordova CLI:
$ cordova plugin add cordova-plugin-headsetdetection$ cordova prepare
HeadsetDetection works with PhoneGap build too, just add the following xml to your
config.xml to always use the latest version of this plugin:
The successCallback (first argument) is a boolean (true or false). Couldn't be easier :)
If you need to respond to removal or added headset while your app i running, you can use the
HeadsetDetection.registerRemoteEvents function and listen for either
This plugin was created by and enhanced for Plugman / PhoneGap Build by Eddy Verbruggen.
registerRemoteEvents function was added by Gerhard Sletten.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.