Skip to content

Commit 370950c

Browse files
committed
extra comments on iOS
1 parent e4d9535 commit 370950c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react-native-sdk/ios/StreamInCallManager.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ class StreamInCallManager: RCTEventEmitter {
7979
options: session.categoryOptions
8080
)
8181
configureAudioSession()
82-
// Enable wake lock to prevent the screen from dimming/locking during a call
82+
8383
DispatchQueue.main.async {
84+
// Enable wake lock to prevent the screen from dimming/locking during a call
8485
UIApplication.shared.isIdleTimerDisabled = true
86+
// Register for audio route changes to turn off screen when earpiece is connected
8587
self.registerAudioRouteObserver()
8688
self.updateProximityMonitoring()
8789
self.log("Wake lock enabled (idle timer disabled)")
@@ -120,8 +122,10 @@ class StreamInCallManager: RCTEventEmitter {
120122
}
121123
// Disable wake lock and proximity when call manager stops so the device can sleep again
122124
DispatchQueue.main.async {
125+
// Disable proximity monitoring to disable earpiece detection
123126
self.setProximityMonitoringEnabled(false)
124127
self.unregisterAudioRouteObserver()
128+
// Disable wake lock to allow the screen to dim/lock again
125129
UIApplication.shared.isIdleTimerDisabled = false
126130
self.log("Wake lock disabled (idle timer enabled)")
127131
}

0 commit comments

Comments
 (0)