Skip to content

Commit 38d9255

Browse files
jdeggerfabriziomoscon
authored andcommitted
fix: always disable proximityMonitor on iOS when the call is disconnected
1 parent 7cd849d commit 38d9255

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ios/RNTwilioVoice/RNTwilioVoice.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,9 @@ - (void)call:(TVOCall *)call didDisconnectWithError:(NSError *)error {
515515
NSLog(@"didDisconnect");
516516
}
517517

518+
UIDevice* device = [UIDevice currentDevice];
519+
device.proximityMonitoringEnabled = NO;
520+
518521
if (!self.userInitiatedDisconnect) {
519522
CXCallEndedReason reason = CXCallEndedReasonRemoteEnded;
520523
if (error) {
@@ -734,8 +737,6 @@ - (void)performEndCallActionWithUUID:(NSUUID *)uuid {
734737
if (uuid == nil) {
735738
return;
736739
}
737-
UIDevice* device = [UIDevice currentDevice];
738-
device.proximityMonitoringEnabled = NO;
739740

740741
CXEndCallAction *endCallAction = [[CXEndCallAction alloc] initWithCallUUID:uuid];
741742
CXTransaction *transaction = [[CXTransaction alloc] initWithAction:endCallAction];

0 commit comments

Comments
 (0)