Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

Commit

Permalink
Merge pull request #35 from aarkalyk/end-all-calls-added
Browse files Browse the repository at this point in the history
Method for ending all calls
  • Loading branch information
ianlin authored Feb 27, 2018
2 parents 9c9f128 + 4478a83 commit c867951
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ export default class RNCallKit {
_RNCallKit.endCall(uuid);
}

static endAllCalls() {
if (Platform.OS !== 'ios') return;
_RNCallKit.endAllCalls();
}

/*
static setHeldCall(uuid, onHold) {
if (Platform.OS !== 'ios') return;
Expand Down
12 changes: 12 additions & 0 deletions ios/RNCallKit/RNCallKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ - (void)dealloc
[self requestTransaction:transaction];
}

RCT_EXPORT_METHOD(endAllCalls)
{
#ifdef DEBUG
NSLog(@"[RNCallKit][endAllCalls] calls = %@", self.callKitCallController.callObserver.calls);
#endif
for (CXCall *call in self.callKitCallController.callObserver.calls) {
CXEndCallAction *endCallAction = [[CXEndCallAction alloc] initWithCallUUID:call.UUID];
CXTransaction *transaction = [[CXTransaction alloc] initWithAction:endCallAction];
[self requestTransaction:transaction];
}
}

RCT_EXPORT_METHOD(setHeldCall:(NSString *)uuidString onHold:(BOOL)onHold)
{
#ifdef DEBUG
Expand Down

0 comments on commit c867951

Please sign in to comment.