HeadsetDetection-PhoneGap-Plugin icon indicating copy to clipboard operation
HeadsetDetection-PhoneGap-Plugin copied to clipboard

plugin not working on android 5.1.1

Open nipungarg6138 opened this issue 7 years ago • 0 comments

I tried the plugin and Android 5 it was working fine. But on Android 5.1.1 it is not working. I mean not detecting headset. Below are the codes.

function plays() { window.HeadsetDetection.detect(function(detected) { alert('hi');
window.plugins.insomnia.keepAwake() cordova.plugins.tonegenerator.play(250) })

document.addEventListener('deviceready', function() { window.HeadsetDetection.registerRemoteEvents(function(status) { switch (status) { case 'headsetAdded': // alert('hi'); window.plugins.insomnia.keepAwake() cordova.plugins.tonegenerator.play(250) break; case 'headsetRemoved': alert('Please connect to Headset/Earpiece then play.'); break; }; }); }, false); Any advise what am i doing wrong? }

nipungarg6138 avatar Oct 04 '17 16:10 nipungarg6138