Skip to content

Add ability to prevent unmute for active calls#118

Open
jerry2013 wants to merge 7 commits into
developfrom
jerry_hu/add-ability-to-prevent-unmute
Open

Add ability to prevent unmute for active calls#118
jerry2013 wants to merge 7 commits into
developfrom
jerry_hu/add-ability-to-prevent-unmute

Conversation

@jerry2013
Copy link
Copy Markdown

@jerry2013 jerry2013 commented Jun 5, 2026

This pull request introduces support for controlling whether a call can be unmuted on iOS by adding an allowUnmute property to active calls. This allows the app to programmatically prevent users from unmuting during a call. The Android implementation does not support this feature and returns an error if called. The main changes are grouped by platform below.

iOS: Allow Unmute Feature

  • Added a new method setAllowUnmute to CordovaCall that allows toggling whether unmuting is permitted for a specific call session. This updates the allowUnmute property in the active call entry. (src/ios/CordovaCall.h, src/ios/CordovaCall.m) [1] [2]
  • Updated the logic in the CallKit mute action handler to reject unmute requests if allowUnmute is set to NO, providing an error message and reverting the UI toggle. (src/ios/CordovaCall.m)
  • Ensured that new active call entries default to allowUnmute: YES. (src/ios/CordovaCall.m)

JavaScript API:

  • Added a new method setAllowUnmute to the JavaScript interface, allowing apps to call this functionality from JS. (www/CordovaCall.js)

Android:

  • Added a stub for setAllowUnmute that always returns an error, as this feature is not supported on Android. (src/android/CordovaCall.java)

@jerry2013 jerry2013 self-assigned this Jun 5, 2026
Copilot AI review requested due to automatic review settings June 5, 2026 00:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a per-call “allow unmute” flag so consumers can prevent an active call from being unmuted (primarily via CallKit on iOS).

Changes:

  • Added a new JS API setAllowUnmute(sessionId, value, ...) to send the flag to native code.
  • Implemented setAllowUnmute on iOS and enforced it by rejecting unmute requests in performSetMutedCallAction.
  • Added an Android setAllowUnmute action handler (currently a stub that always succeeds).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
www/CordovaCall.js Exposes setAllowUnmute to JS and forwards sessionId + boolean to native.
src/ios/CordovaCall.m Stores allowUnmute per active call, defaults it to YES, and blocks CallKit unmute actions when disabled.
src/ios/CordovaCall.h Declares the new iOS plugin method.
src/android/CordovaCall.java Adds an execute branch for setAllowUnmute (currently returns success without enforcing behavior).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ios/CordovaCall.m Outdated
Comment thread src/android/CordovaCall.java
Comment thread src/ios/CordovaCall.m Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jerry Hu <4749863+jerry2013@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread www/CordovaCall.js Outdated
Comment thread src/android/CordovaCall.java
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread src/ios/CordovaCall.m
Comment thread src/android/CordovaCall.java
jerry2013 and others added 3 commits June 5, 2026 09:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants