react-native-webrtc / react-native-webrtc/react-native-callkeep

Report call ended if an unanswered incoming call is terminated from AppDelegate.m

Open
#543 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
511
Avg merge
9h 12m
Merged PRs (30d)
2

Description

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-callkeep@4.3.2 for the project I'm working on.

We set a timeout for any incoming call from within native Objective C. If the call is ended from within Objective C, our react native app does not receive an event telling it the call has been ended. I emit an event so that we can update application state.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-callkeep/ios/RNCallKeep/RNCallKeep.m b/node_modules/react-native-callkeep/ios/RNCallKeep/RNCallKeep.m
index 3687bd2..706368a 100644
--- a/node_modules/react-native-callkeep/ios/RNCallKeep/RNCallKeep.m
+++ b/node_modules/react-native-callkeep/ios/RNCallKeep/RNCallKeep.m
@@ -649,6 +649,14 @@ RCT_EXPORT_METHOD(getAudioRoutes: (RCTPromiseResolveBlock)resolve
         default:
             break;
     }
+
+    /**
+        endCallWithUUID may have been called from AppDelegate.m
+        We need to let JS know that the call has ended so it can make 
+        any necessary updates to application state
+    */
+    RNCallKeep *callKeep = [RNCallKeep allocWithZone: nil];
+    [callKeep sendEventWithNameWrapper:RNCallKeepPerformEndCallAction body:@{ @"callUUID": [uuidString lowercaseString] }];
 }
 
 + (void)reportNewIncomingCall:(NSString *)uuidString

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ios/RNCallKeep/RNCallKeep.m and trace the endCallWithUUID path used when an incoming call is terminated from native Objective-C or AppDelegate.m. Verify how the React Native ended-call event is dispatched and how the existing callUUID is formatted. Done means the JavaScript app receives an event for this termination path without breaking other call-ending flows.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.