Skip to content

Commit 5286fee

Browse files
committed
Updated with requested changes
1 parent a4a33e1 commit 5286fee

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,21 @@ Be sure to set this only after your call is ready for two way audio; used both i
136136
RNCallKeep.setCurrentCallActive(uuid);
137137
```
138138

139+
- `uuid`: string
140+
- The `uuid` used for `startCall` or `displayIncomingCall`
141+
142+
### isCallActive
143+
_This feature is available only on IOS._
144+
145+
Returns true if the UUID passed matches an existing and answered call.
146+
This will return true ONLY if the call exists and the user has already answered the call. It will return false
147+
if the call does not exist or has not been answered. This is exposed to both React Native and Native sides.
148+
This was exposed so a call can be canceled if ringing and the user answered on a different device.
149+
150+
```js
151+
RNCallKeep.isCallActive(uuid);
152+
```
153+
139154
- `uuid`: string
140155
- The `uuid` used for `startCall` or `displayIncomingCall`
141156

ios/RNCallKeep/RNCallKeep.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,13 @@ - (void)requestTransaction:(CXTransaction *)transaction
304304
}];
305305
}
306306

307-
+ (BOOL)checkIfActiveCall:(NSString *)uuidString
307+
+ (BOOL)isCallActive:(NSString *)uuidString
308308
{
309309
CXCallObserver *callObserver = [[CXCallObserver alloc] init];
310310
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:uuidString];
311311

312312
for(CXCall *call in callObserver.calls){
313-
NSLog(@"Connected: %d", [call.UUID isEqual:uuid]);
313+
NSLog(@"[RNCallKeep] isCallActive %@ %d ?", call.UUID, [call.UUID isEqual:uuid]);
314314
if([call.UUID isEqual:[[NSUUID alloc] initWithUUIDString:uuidString]] && !call.hasConnected){
315315
return true;
316316
}

0 commit comments

Comments
 (0)