File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ export default class RNCallKit {
86
86
_RNCallKit . endCall ( uuid ) ;
87
87
}
88
88
89
+ static endAllCalls ( ) {
90
+ if ( Platform . OS !== 'ios' ) return ;
91
+ _RNCallKit . endAllCalls ( ) ;
92
+ }
93
+
89
94
/*
90
95
static setHeldCall(uuid, onHold) {
91
96
if (Platform.OS !== 'ios') return;
Original file line number Diff line number Diff line change @@ -144,6 +144,18 @@ - (void)dealloc
144
144
[self requestTransaction: transaction];
145
145
}
146
146
147
+ RCT_EXPORT_METHOD (endAllCalls)
148
+ {
149
+ #ifdef DEBUG
150
+ NSLog (@" [RNCallKit][endAllCalls] calls = %@ " , self.callKitCallController .callObserver .calls );
151
+ #endif
152
+ for (CXCall *call in self.callKitCallController .callObserver .calls ) {
153
+ CXEndCallAction *endCallAction = [[CXEndCallAction alloc ] initWithCallUUID: call.UUID];
154
+ CXTransaction *transaction = [[CXTransaction alloc ] initWithAction: endCallAction];
155
+ [self requestTransaction: transaction];
156
+ }
157
+ }
158
+
147
159
RCT_EXPORT_METHOD (setHeldCall:(NSString *)uuidString onHold:(BOOL )onHold)
148
160
{
149
161
#ifdef DEBUG
You can’t perform that action at this time.
0 commit comments