Skip to content

Commit

Permalink
Bugfix: incorrect events
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Zhai committed Dec 8, 2020
1 parent bb3958c commit 74d7bb8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions iOS/RCTCallDetection/RCTCallDetection/CallDetectionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,13 @@ + (BOOL)requiresMainQueueSetup {
- (void)callObserver:(CXCallObserver *)callObserver callChanged:(CXCall *)call {
if (call.hasEnded == true) {
[self sendEventWithName:@"PhoneCallStateUpdate" body:@"Disconnected"];
}
if (call.isOutgoing == true && call.hasConnected == false && call.hasEnded == false) {
} else if (call.hasConnected == true) {
[self sendEventWithName:@"PhoneCallStateUpdate" body:@"Connected"];
} else if (call.isOutgoing == true) {
[self sendEventWithName:@"PhoneCallStateUpdate" body:@"Dialing"];
}
if (call.isOutgoing == false && call.hasConnected == false) {
} else {
[self sendEventWithName:@"PhoneCallStateUpdate" body:@"Incoming"];
}
if (call.hasEnded == false && call.hasConnected == true) {
[self sendEventWithName:@"PhoneCallStateUpdate" body:@"Connected"];
}
}

@end

0 comments on commit 74d7bb8

Please sign in to comment.