edimuj / cordova-plugin-audioinput

This iOS/Android Cordova/PhoneGap plugin enables audio capture from the device microphone, by in near real-time forwarding audio to the web layer of your application. A typical usage scenario for this plugin would be to use the captured audio as source for a web audio node chain, where it then can be analyzed, manipulated and/or played.

Home Page:https://github.com/edimuj/app-audioinput-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getMicrophonePermission not opening permission popup after denying it first time in iOS

kvharish opened this issue · comments

Used the below code given in example but "Ask the user for permission to access the microphone" part of the code does not open the permission popup the second time. Please note the first time I denied access.

// First check whether we already have permission to access the microphone.
window.audioinput.checkMicrophonePermission(function(hasPermission) {
if (hasPermission) {
console.log("We already have permission to record.");
startCapture();
}
else {
// Ask the user for permission to access the microphone
window.audioinput.getMicrophonePermission(function(hasPermission, message) {
if (hasPermission) {
console.log("User granted us permission to record.");
startCapture();
} else {
console.warn("User denied permission to record.");
}
});
}
});

Please forgive the alignment. Can someone help?

This is, unfortunately, a behaviour in iOS. If you deny access, iOS will never ask again, the user has to go into the app settings and explicitly enable microphone permission.
(On Android, there's a 'don't ask again' checkbox that has the same effect, but it's unchecked by default, so generally, they'll be repeated asked until they check the box or allow permission)

Thanks for the clarification. Closing this.