react-native-callkeep
react-native-callkeep copied to clipboard
Report call ended if an unanswered incoming call is terminated from AppDelegate.m
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.
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