react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

Keeping Mute Action in sync with Device and Remove duplicate functions exported to React Native

Open sgoel1495 opened this issue 6 months ago • 1 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java b/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
index 025480a..a6b5236 100644
--- a/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
+++ b/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java
@@ -189,7 +189,7 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule implements Life
     public void reportNewIncomingCall(String uuid, String number, String callerName, boolean hasVideo, String payload) {
         Log.d(TAG, "[RNCallKeepModule] reportNewIncomingCall, uuid: " + uuid + ", number: " + number + ", callerName: " + callerName);
 
-        this.displayIncomingCall(uuid, number, callerName, hasVideo);
+        this.displayIncomingCall(uuid, number, callerName, hasVideo, null);
 
         // Send event to JS
         WritableMap args = Arguments.createMap();
@@ -434,10 +434,6 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule implements Life
         this.hasListeners = false;
     }
 
-    @ReactMethod
-    public void displayIncomingCall(String uuid, String number, String callerName) {
-        this.displayIncomingCall(uuid, number, callerName, false, null);
-    }
 
     @ReactMethod
     public void displayIncomingCall(String uuid, String number, String callerName, boolean hasVideo) {
@@ -483,11 +479,6 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule implements Life
         conn.onAnswer();
     }
 
-    @ReactMethod
-    public void startCall(String uuid, String number, String callerName) {
-        this.startCall(uuid, number, callerName, false, null);
-    }
-
     @ReactMethod
     public void startCall(String uuid, String number, String callerName, boolean hasVideo) {
         this.startCall(uuid, number, callerName, hasVideo, null);
@@ -795,7 +786,8 @@ public class RNCallKeepModule extends ReactContextBaseJavaModule implements Life
             Log.w(TAG, "[RNCallKeepModule] setMutedCall ignored because no connection found, uuid: " + uuid);
             return;
         }
-
+        AudioManager audio = (AudioManager) reactContext.getSystemService(Context.AUDIO_SERVICE);
+        audio.setMicrophoneMute(shouldMute);
         CallAudioState newAudioState = null;
         //if the requester wants to mute, do that. otherwise unmute
         if (shouldMute) {

This issue body was partially generated by patch-package.

sgoel1495 avatar Jul 13 '25 09:07 sgoel1495

FYI if you use yarn this comes for free without needing patch-package via yarn patch

jasonsemkohoag avatar Jul 19 '25 04:07 jasonsemkohoag