apache / apache/cordova-plugin-media

Error callback not fired if user denies mic access

Open
#267 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
391
Forks
762
PR merge metrics
No merged PRs in 30d

Description

# Bug Report

## Problem
I'm trying to use `startRecord` on Android but no callback is fired if user denies mic permission.

### What is expected to happen?
Error callback (third argument of Media constructor) should be fired if the user refuses to give RECORDING permission.

### What does actually happen?
No callback (success, error or status) is fired.

## Information
If the user denies grants, the second time `startRecord` is called also success and status callbacks are disabled (even if the user give the permissions). Restarting the app is required to make it work.
Logcat says: Attempted to send a second callback for ID: Media1253750911

This also happens using the code from the `startRecording` section in the README,

### Environment, Platform, Device
Android 9.0

## Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start with the startRecord example in the README and trace the Android handling behind the Media constructor's error callback. Reproduce the denied RECORDING permission case on Android 9 and inspect Logcat for the duplicate callback message. Done means the error callback fires once on denial, and later startRecord calls still deliver their callbacks without requiring an app restart.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.