@stream-io/react-native-callingx 0.1.0-beta.1 → 0.1.0-beta.2

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.
@@ -15,7 +15,7 @@ import stream_react_native_webrtc
15
15
  #else
16
16
  categoryOptions = [.allowBluetooth, .defaultToSpeaker]
17
17
  #endif
18
- let mode: AVAudioSession.Mode = .videoChat
18
+ let mode: AVAudioSession.Mode = .voiceChat
19
19
 
20
20
  // Configure RTCAudioSessionConfiguration to match our intended settings
21
21
  // This ensures WebRTC's internal state stays consistent during interruptions/route changes
@@ -31,12 +31,7 @@ import stream_react_native_webrtc
31
31
  defer { rtcSession.unlockForConfiguration() }
32
32
 
33
33
  do {
34
- try rtcSession.setCategory(.playAndRecord, mode: mode, options: categoryOptions)
35
-
36
- // Apply sample rate and IO buffer duration from WebRTC's config (source of truth)
37
- // This keeps CallKit setup aligned with WebRTC's intended tuning (e.g. 48kHz and ~20ms by default)
38
- try rtcSession.setPreferredSampleRate(rtcConfig.sampleRate)
39
- try rtcSession.setPreferredIOBufferDuration(rtcConfig.ioBufferDuration)
34
+ try rtcSession.setConfiguration(rtcConfig)
40
35
  } catch {
41
36
  #if DEBUG
42
37
  print("[Callingx][createAudioSessionIfNeeded] Error configuring audio session: \(error)")
@@ -385,6 +385,7 @@ import stream_react_native_webrtc
385
385
  callerName: String,
386
386
  hasVideo: Bool
387
387
  ) -> Bool {
388
+ let uuid = CallingxImpl.uuidStorage?.getUUID(forCid: callId)
388
389
  CallingxImpl.reportNewIncomingCall(
389
390
  callId: callId,
390
391
  handle: phoneNumber,
@@ -400,15 +401,18 @@ import stream_react_native_webrtc
400
401
  completion: nil
401
402
  )
402
403
 
403
- let settings = Settings.getSettings()
404
- if let timeout = settings["displayCallTimeout"] as? Int {
405
- let popTime = DispatchTime.now() + .milliseconds(timeout)
406
- DispatchQueue.main.asyncAfter(deadline: popTime) { [weak self] in
407
- guard let self = self, !self.isSetup else { return }
408
- #if DEBUG
409
- print("[Callingx] Displayed a call without a reachable app, ending the call: \(callId)")
410
- #endif
411
- CallingxImpl.endCall(callId, reason: CXCallEndedReason.failed.rawValue)
404
+ let wasAlreadyAnswered = uuid != nil
405
+ if !wasAlreadyAnswered {
406
+ let settings = Settings.getSettings()
407
+ if let timeout = settings["displayCallTimeout"] as? Int {
408
+ let popTime = DispatchTime.now() + .milliseconds(timeout)
409
+ DispatchQueue.main.asyncAfter(deadline: popTime) { [weak self] in
410
+ guard let self = self, !self.isSetup else { return }
411
+ #if DEBUG
412
+ print("[Callingx] Displayed a call without a reachable app, ending the call: \(callId)")
413
+ #endif
414
+ CallingxImpl.endCall(callId, reason: CXCallEndedReason.failed.rawValue)
415
+ }
412
416
  }
413
417
  }
414
418
  return true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/react-native-callingx",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.2",
4
4
  "description": "CallKit and Telecom API capabilities for React Native",
5
5
  "main": "./dist/module/index.js",
6
6
  "module": "./dist/module/index.js",
@@ -61,7 +61,7 @@
61
61
  "devDependencies": {
62
62
  "@react-native-community/cli": "20.0.1",
63
63
  "@react-native/babel-preset": "^0.81.5",
64
- "@stream-io/react-native-webrtc": "137.1.0",
64
+ "@stream-io/react-native-webrtc": "137.1.1",
65
65
  "@types/react": "^19.1.0",
66
66
  "del-cli": "^6.0.0",
67
67
  "react": "19.1.0",
@@ -70,7 +70,7 @@
70
70
  "typescript": "^5.9.2"
71
71
  },
72
72
  "peerDependencies": {
73
- "@stream-io/react-native-webrtc": ">=137.1.0",
73
+ "@stream-io/react-native-webrtc": ">=137.1.1",
74
74
  "react": "*",
75
75
  "react-native": "*"
76
76
  },