@stream-io/react-native-callingx 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/ios/AudioSessionManager.swift +42 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.5.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/react-native-callingx-0.5.0...@stream-io/react-native-callingx-0.5.1) (2026-06-12)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **ios:** joining a call muted may break remote audio playout ([#2282](https://github.com/GetStream/stream-video-js/issues/2282)) ([dc672a6](https://github.com/GetStream/stream-video-js/commit/dc672a69971d6ca46648696c242609c687cb42d7))
|
|
10
|
+
|
|
5
11
|
## [0.5.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/react-native-callingx-0.4.0...@stream-io/react-native-callingx-0.5.0) (2026-06-11)
|
|
6
12
|
|
|
7
13
|
### Features
|
|
@@ -65,36 +65,59 @@ enum DefaultAudioDevice {
|
|
|
65
65
|
// MARK: - Private
|
|
66
66
|
|
|
67
67
|
private func applyCallKitConfiguration() {
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
let bluetoothOption: AVAudioSession.CategoryOptions = .allowBluetoothHFP
|
|
74
|
-
#else
|
|
75
|
-
let bluetoothOption: AVAudioSession.CategoryOptions = .allowBluetooth
|
|
76
|
-
#endif
|
|
77
|
-
|
|
78
|
-
var categoryOptions: AVAudioSession.CategoryOptions = [bluetoothOption, .allowBluetoothA2DP]
|
|
79
|
-
if currentDevice == .speaker {
|
|
80
|
-
categoryOptions.insert(.defaultToSpeaker)
|
|
81
|
-
}
|
|
68
|
+
let rtcSession = RTCAudioSession.sharedInstance()
|
|
69
|
+
|
|
70
|
+
// Relax to a pure-output (.playback) session when mic permission is missing
|
|
71
|
+
// same logic as in StreamInCallManager
|
|
72
|
+
let usePlaybackFallback = !micPermissionGranted()
|
|
82
73
|
|
|
83
74
|
// webRTC() singleton hardcodes sampleRate=48000 / ioBufferDuration=0.02 — keep those.
|
|
84
75
|
let rtcConfig = RTCAudioSessionConfiguration.webRTC()
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
if usePlaybackFallback {
|
|
77
|
+
// Known gap: .playback can't route to the receiver (earpiece) — that route
|
|
78
|
+
// only exists under .playAndRecord.
|
|
79
|
+
rtcConfig.category = AVAudioSession.Category.playback.rawValue
|
|
80
|
+
rtcConfig.mode = AVAudioSession.Mode.spokenAudio.rawValue
|
|
81
|
+
rtcConfig.categoryOptions = []
|
|
82
|
+
} else {
|
|
83
|
+
let currentDevice = stateQueue.sync { defaultAudioDevice }
|
|
84
|
+
|
|
85
|
+
// XCode 16 and older don't expose .allowBluetoothHFP
|
|
86
|
+
// https://forums.swift.org/t/xcode-26-avaudiosession-categoryoptions-allowbluetooth-deprecated/80956
|
|
87
|
+
#if compiler(>=6.2) // For Xcode 26.0+
|
|
88
|
+
let bluetoothOption: AVAudioSession.CategoryOptions = .allowBluetoothHFP
|
|
89
|
+
#else
|
|
90
|
+
let bluetoothOption: AVAudioSession.CategoryOptions = .allowBluetooth
|
|
91
|
+
#endif
|
|
92
|
+
|
|
93
|
+
var categoryOptions: AVAudioSession.CategoryOptions = [bluetoothOption, .allowBluetoothA2DP]
|
|
94
|
+
if currentDevice == .speaker {
|
|
95
|
+
categoryOptions.insert(.defaultToSpeaker)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
rtcConfig.category = AVAudioSession.Category.playAndRecord.rawValue
|
|
99
|
+
rtcConfig.mode = AVAudioSession.Mode.voiceChat.rawValue
|
|
100
|
+
rtcConfig.categoryOptions = categoryOptions
|
|
101
|
+
}
|
|
88
102
|
RTCAudioSessionConfiguration.setWebRTC(rtcConfig)
|
|
89
103
|
|
|
90
|
-
|
|
104
|
+
CallingxLog.audio.debugPublic("[applyCallKitConfiguration] category=\(rtcConfig.category) mode=\(rtcConfig.mode)")
|
|
105
|
+
|
|
91
106
|
rtcSession.lockForConfiguration()
|
|
92
107
|
defer { rtcSession.unlockForConfiguration() }
|
|
93
108
|
|
|
94
109
|
do {
|
|
95
110
|
try rtcSession.setConfiguration(rtcConfig)
|
|
96
111
|
} catch {
|
|
97
|
-
CallingxLog.audio.errorPublic("[
|
|
112
|
+
CallingxLog.audio.errorPublic("[applyCallKitConfiguration] Error: \(error)")
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
private func micPermissionGranted() -> Bool {
|
|
117
|
+
if #available(iOS 17.0, *) {
|
|
118
|
+
return AVAudioApplication.shared.recordPermission == .granted
|
|
119
|
+
} else {
|
|
120
|
+
return AVAudioSession.sharedInstance().recordPermission == .granted
|
|
98
121
|
}
|
|
99
122
|
}
|
|
100
123
|
}
|
package/package.json
CHANGED