@stream-io/video-react-native-sdk 1.31.1-beta.0 → 1.31.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.
Files changed (217) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/android/src/main/AndroidManifest.xml +1 -8
  3. package/android/src/main/AndroidManifestNew.xml +0 -11
  4. package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +5 -42
  5. package/android/src/main/java/com/streamvideo/reactnative/audio/utils/WebRtcAudioUtils.kt +6 -70
  6. package/android/src/main/java/com/streamvideo/reactnative/callmanager/StreamInCallManagerModule.kt +4 -6
  7. package/android/src/main/java/com/streamvideo/reactnative/util/CallAliveServiceChecker.kt +95 -0
  8. package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js +2 -6
  9. package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
  10. package/dist/commonjs/hooks/push/index.js +2 -0
  11. package/dist/commonjs/hooks/push/index.js.map +1 -1
  12. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +160 -0
  13. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  14. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  15. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  16. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +67 -0
  17. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -0
  18. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +97 -64
  19. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  20. package/dist/commonjs/index.js +0 -1
  21. package/dist/commonjs/index.js.map +1 -1
  22. package/dist/commonjs/modules/call-manager/CallManager.js +0 -26
  23. package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
  24. package/dist/commonjs/providers/StreamCall/index.js +6 -6
  25. package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
  26. package/dist/commonjs/utils/StreamVideoRN/index.js +21 -35
  27. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  28. package/dist/commonjs/utils/internal/registerSDKGlobals.js +3 -53
  29. package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
  30. package/dist/commonjs/utils/push/android.js +202 -135
  31. package/dist/commonjs/utils/push/android.js.map +1 -1
  32. package/dist/commonjs/utils/push/internal/ios.js +34 -17
  33. package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
  34. package/dist/commonjs/utils/push/internal/rxSubjects.js +45 -1
  35. package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
  36. package/dist/commonjs/utils/push/internal/utils.js +53 -71
  37. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  38. package/dist/commonjs/utils/push/ios.js.map +1 -1
  39. package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
  40. package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
  41. package/dist/commonjs/utils/push/libs/index.js +19 -8
  42. package/dist/commonjs/utils/push/libs/index.js.map +1 -1
  43. package/dist/commonjs/utils/push/libs/notifee/index.js +19 -0
  44. package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
  45. package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
  46. package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
  47. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +205 -0
  48. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -0
  49. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
  50. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
  51. package/dist/commonjs/version.js +1 -1
  52. package/dist/commonjs/version.js.map +1 -1
  53. package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js +2 -6
  54. package/dist/module/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
  55. package/dist/module/hooks/push/index.js +2 -0
  56. package/dist/module/hooks/push/index.js.map +1 -1
  57. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +153 -0
  58. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  59. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  60. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  61. package/dist/module/hooks/push/useProcessPushCallEffect.js +60 -0
  62. package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -0
  63. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +99 -66
  64. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  65. package/dist/module/index.js +0 -1
  66. package/dist/module/index.js.map +1 -1
  67. package/dist/module/modules/call-manager/CallManager.js +0 -26
  68. package/dist/module/modules/call-manager/CallManager.js.map +1 -1
  69. package/dist/module/providers/StreamCall/index.js +6 -6
  70. package/dist/module/providers/StreamCall/index.js.map +1 -1
  71. package/dist/module/utils/StreamVideoRN/index.js +21 -35
  72. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  73. package/dist/module/utils/internal/registerSDKGlobals.js +3 -53
  74. package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
  75. package/dist/module/utils/push/android.js +204 -137
  76. package/dist/module/utils/push/android.js.map +1 -1
  77. package/dist/module/utils/push/internal/ios.js +34 -17
  78. package/dist/module/utils/push/internal/ios.js.map +1 -1
  79. package/dist/module/utils/push/internal/rxSubjects.js +44 -0
  80. package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
  81. package/dist/module/utils/push/internal/utils.js +50 -67
  82. package/dist/module/utils/push/internal/utils.js.map +1 -1
  83. package/dist/module/utils/push/ios.js.map +1 -1
  84. package/dist/module/utils/push/libs/callkeep.js +11 -0
  85. package/dist/module/utils/push/libs/callkeep.js.map +1 -0
  86. package/dist/module/utils/push/libs/index.js +2 -1
  87. package/dist/module/utils/push/libs/index.js.map +1 -1
  88. package/dist/module/utils/push/libs/notifee/index.js +18 -0
  89. package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
  90. package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
  91. package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
  92. package/dist/module/utils/push/setupIosCallKeepEvents.js +199 -0
  93. package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -0
  94. package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
  95. package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
  96. package/dist/module/version.js +1 -1
  97. package/dist/module/version.js.map +1 -1
  98. package/dist/typescript/components/Participant/ParticipantView/ParticipantLabel.d.ts.map +1 -1
  99. package/dist/typescript/hooks/push/index.d.ts.map +1 -1
  100. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +5 -0
  101. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -0
  102. package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
  103. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +8 -0
  104. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -0
  105. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  106. package/dist/typescript/index.d.ts +0 -1
  107. package/dist/typescript/index.d.ts.map +1 -1
  108. package/dist/typescript/modules/call-manager/CallManager.d.ts +0 -5
  109. package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
  110. package/dist/typescript/utils/StreamVideoRN/index.d.ts +2 -22
  111. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  112. package/dist/typescript/utils/StreamVideoRN/types.d.ts +25 -59
  113. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  114. package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
  115. package/dist/typescript/utils/push/android.d.ts +2 -1
  116. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  117. package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
  118. package/dist/typescript/utils/push/internal/rxSubjects.d.ts +33 -0
  119. package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
  120. package/dist/typescript/utils/push/internal/utils.d.ts +8 -14
  121. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  122. package/dist/typescript/utils/push/ios.d.ts +2 -1
  123. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  124. package/dist/typescript/utils/push/libs/callkeep.d.ts +3 -0
  125. package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
  126. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +2 -16
  127. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
  128. package/dist/typescript/utils/push/libs/index.d.ts +2 -1
  129. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
  130. package/dist/typescript/utils/push/libs/notifee/index.d.ts +1 -0
  131. package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
  132. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +3 -0
  133. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +1 -0
  134. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +6 -0
  135. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -0
  136. package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
  137. package/dist/typescript/version.d.ts +1 -1
  138. package/dist/typescript/version.d.ts.map +1 -1
  139. package/expo-config-plugin/dist/withAndroidManifest.js +33 -1
  140. package/expo-config-plugin/dist/withAndroidPermissions.js +7 -2
  141. package/expo-config-plugin/dist/withAppDelegate.js +197 -19
  142. package/expo-config-plugin/dist/withMainActivity.js +1 -1
  143. package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -2
  144. package/ios/StreamInCallManager.m +0 -2
  145. package/ios/StreamInCallManager.swift +7 -19
  146. package/ios/StreamVideoReactNative.h +4 -7
  147. package/ios/StreamVideoReactNative.m +82 -189
  148. package/package.json +16 -11
  149. package/src/components/Participant/ParticipantView/ParticipantLabel.tsx +2 -7
  150. package/src/hooks/push/index.ts +2 -0
  151. package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +235 -0
  152. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
  153. package/src/hooks/push/useProcessPushCallEffect.ts +108 -0
  154. package/src/hooks/useAndroidKeepCallAliveEffect.ts +120 -94
  155. package/src/index.ts +0 -1
  156. package/src/modules/call-manager/CallManager.ts +0 -36
  157. package/src/modules/call-manager/native-module.d.ts +0 -7
  158. package/src/providers/StreamCall/index.tsx +6 -6
  159. package/src/utils/StreamVideoRN/index.ts +30 -42
  160. package/src/utils/StreamVideoRN/types.ts +25 -61
  161. package/src/utils/internal/registerSDKGlobals.ts +4 -52
  162. package/src/utils/push/android.ts +311 -198
  163. package/src/utils/push/internal/ios.ts +44 -28
  164. package/src/utils/push/internal/rxSubjects.ts +61 -0
  165. package/src/utils/push/internal/utils.ts +64 -108
  166. package/src/utils/push/ios.ts +6 -1
  167. package/src/utils/push/libs/callkeep.ts +16 -0
  168. package/src/utils/push/libs/index.ts +2 -1
  169. package/src/utils/push/libs/notifee/index.ts +27 -0
  170. package/src/utils/push/libs/voipPushNotification.ts +17 -0
  171. package/src/utils/push/setupIosCallKeepEvents.ts +252 -0
  172. package/src/utils/push/setupIosVoipPushEvents.ts +7 -11
  173. package/src/version.ts +1 -1
  174. package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +0 -83
  175. package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +0 -149
  176. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -144
  177. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  178. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +0 -68
  179. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +0 -1
  180. package/dist/commonjs/utils/internal/callingx/callingx.js +0 -150
  181. package/dist/commonjs/utils/internal/callingx/callingx.js.map +0 -1
  182. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +0 -48
  183. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +0 -1
  184. package/dist/commonjs/utils/push/libs/callingx.js +0 -75
  185. package/dist/commonjs/utils/push/libs/callingx.js.map +0 -1
  186. package/dist/commonjs/utils/push/setupCallingExpEvents.js +0 -105
  187. package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +0 -1
  188. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +0 -137
  189. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  190. package/dist/module/utils/internal/callingx/audioSessionPromise.js +0 -61
  191. package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +0 -1
  192. package/dist/module/utils/internal/callingx/callingx.js +0 -140
  193. package/dist/module/utils/internal/callingx/callingx.js.map +0 -1
  194. package/dist/module/utils/keepCallAliveHeadlessTask.js +0 -42
  195. package/dist/module/utils/keepCallAliveHeadlessTask.js.map +0 -1
  196. package/dist/module/utils/push/libs/callingx.js +0 -67
  197. package/dist/module/utils/push/libs/callingx.js.map +0 -1
  198. package/dist/module/utils/push/setupCallingExpEvents.js +0 -99
  199. package/dist/module/utils/push/setupCallingExpEvents.js.map +0 -1
  200. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +0 -5
  201. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +0 -1
  202. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +0 -16
  203. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +0 -1
  204. package/dist/typescript/utils/internal/callingx/callingx.d.ts +0 -18
  205. package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +0 -1
  206. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +0 -10
  207. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +0 -1
  208. package/dist/typescript/utils/push/libs/callingx.d.ts +0 -9
  209. package/dist/typescript/utils/push/libs/callingx.d.ts.map +0 -1
  210. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +0 -8
  211. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +0 -1
  212. package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +0 -189
  213. package/src/utils/internal/callingx/audioSessionPromise.ts +0 -65
  214. package/src/utils/internal/callingx/callingx.ts +0 -194
  215. package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
  216. package/src/utils/push/libs/callingx.ts +0 -89
  217. package/src/utils/push/setupCallingExpEvents.ts +0 -135
@@ -5,18 +5,6 @@ import {
5
5
  } from '@stream-io/video-client';
6
6
  import type { AndroidChannel } from '@notifee/react-native';
7
7
 
8
- export type AndroidChannelConfig = {
9
- id: string;
10
- name: string;
11
- sound?: string;
12
- vibration?: boolean;
13
- };
14
-
15
- export type KeepAliveAndroidNotificationTexts = {
16
- title: string;
17
- body: string;
18
- };
19
-
20
8
  export type NonRingingPushEvent =
21
9
  | 'call.live_started'
22
10
  | 'call.notification'
@@ -44,27 +32,6 @@ export type StreamVideoConfig = {
44
32
  * @example "production-apn-video" or "staging-apn-video" based on the environment
45
33
  */
46
34
  pushProviderName?: string;
47
- supportsVideo?: boolean;
48
- /**
49
- * Sound to play when an incoming call is received. Must be a valid sound resource name in the project.
50
- * @default '' (no sound)
51
- */
52
- sound?: string;
53
- /**
54
- * Image to display when an incoming call is received. Must be a valid image resource name in the project.
55
- * @default '' (no image)
56
- */
57
- imageName?: string;
58
- /**
59
- * Enable calls history. When enabled, the call will be added to the calls history.
60
- * @default false
61
- */
62
- callsHistory?: boolean;
63
- /**
64
- * Timeout to display an incoming call. When the call is displayed for more than the timeout, the call will be rejected.
65
- * @default 60000 (1 minute)
66
- */
67
- displayCallTimeout?: number;
68
35
  };
69
36
  android: {
70
37
  /**
@@ -94,30 +61,28 @@ export type StreamVideoConfig = {
94
61
  * The notification channel to be used for incoming calls for Android.
95
62
  * @example
96
63
  * {
97
- * id: 'incoming_calls_channel',
98
- * name: 'Incoming calls',
99
- * sound?: string;
100
- * vibration?: boolean;
64
+ * id: 'stream_incoming_call',
65
+ * name: 'Incoming call notifications',
66
+ * importance: AndroidImportance.HIGH,
101
67
  * }
102
68
  */
103
- incomingChannel?: AndroidChannelConfig;
69
+ incomingCallChannel?: AndroidChannel;
104
70
  /**
105
- * Texts used for call state notifications while the system is connecting or declining the call.
106
- * If not provided, platform defaults will be used.
71
+ * Functions to create the texts shown in the notification for incoming calls in Android.
107
72
  * @example
108
73
  * {
109
- * accepting: 'Connecting...',
110
- * rejecting: 'Declining...',
74
+ * getTitle: (createdUserName: string) => `Incoming call from ${createdUserName}`,
75
+ * getBody: (createdUserName: string) => `Tap to answer the call`
76
+ * getAcceptButtonTitle?: () => `Accept`,
77
+ * getDeclineButtonTitle?: () => `Decline`,
111
78
  * }
112
79
  */
113
- notificationTexts?: {
114
- accepting?: string;
115
- rejecting?: string;
80
+ incomingCallNotificationTextGetters?: {
81
+ getTitle: (createdUserName: string) => string;
82
+ getBody: (createdUserName: string) => string;
83
+ getAcceptButtonTitle?: () => string;
84
+ getDeclineButtonTitle?: () => string;
116
85
  };
117
- /**
118
- * The transformer to be used to transform the call title in the notification for ringing and ongoing calls for Android.
119
- */
120
- titleTransformer?: (memberName: string, incoming: boolean) => string;
121
86
  /**
122
87
  * Functions to create the texts shown in the notification for non ringing calls in Android.
123
88
  * @example
@@ -146,16 +111,6 @@ export type StreamVideoConfig = {
146
111
  getBody: (type: NonRingingPushEvent, createdUserName: string) => string;
147
112
  };
148
113
  };
149
- /**
150
- * Whether to enable ongoing calls.
151
- * @default false
152
- */
153
- enableOngoingCalls?: boolean;
154
- /**
155
- * Whether to reject calls when the user is busy.
156
- * @default false
157
- */
158
- shouldRejectCallWhenBusy?: boolean;
159
114
  /**
160
115
  * This function is used to create a custom video client.
161
116
  * This is used create a video client for incoming calls in the background and inform call events to the server.
@@ -175,6 +130,12 @@ export type StreamVideoConfig = {
175
130
  * }
176
131
  */
177
132
  createStreamVideoClient: () => Promise<StreamVideoClient | undefined>;
133
+ /** @deprecated This method will be removed in the future. Please watch for incoming and outgoing calls in the root component of your app.
134
+ Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information */
135
+ navigateAcceptCall?: () => void;
136
+ /** @deprecated This method will be removed in the future. Please watch for incoming and outgoing calls in the root component of your app.
137
+ Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information */
138
+ navigateToIncomingCall?: () => void;
178
139
  /** Callback that is called when a non ringing push notification was tapped */
179
140
  onTapNonRingingCallNotification?: (
180
141
  call_cid: string,
@@ -186,11 +147,14 @@ export type StreamVideoConfig = {
186
147
  /**
187
148
  * The notification channel to keep call alive in the background for Android using a foreground service.
188
149
  */
189
- channel: Omit<AndroidChannelConfig, 'sound' | 'vibration'>;
150
+ channel: AndroidChannel;
190
151
  /**
191
152
  * The texts shown in the notification to keep call alive in the background
192
153
  */
193
- notificationTexts: KeepAliveAndroidNotificationTexts;
154
+ notificationTexts: {
155
+ title: string;
156
+ body: string;
157
+ };
194
158
  /**
195
159
  * The task to run in the foreground service
196
160
  * The task must resolve a promise once complete
@@ -1,71 +1,23 @@
1
- import { StreamRNVideoSDKGlobals } from '@stream-io/video-client';
1
+ import type { StreamRNVideoSDKGlobals } from '@stream-io/video-client';
2
2
  import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
3
- import { getCallingxLibIfAvailable } from '../push/libs/callingx';
4
- import {
5
- endCallingxCall,
6
- registerOutgoingCall,
7
- joinCallingxCall,
8
- } from './callingx/callingx';
9
3
 
10
4
  const StreamInCallManagerNativeModule = NativeModules.StreamInCallManager;
11
5
  const StreamVideoReactNativeModule = NativeModules.StreamVideoReactNative as {
12
6
  checkPermission: StreamRNVideoSDKGlobals['permissions']['check'] | undefined;
13
7
  };
14
8
 
15
- const CallingxModule = getCallingxLibIfAvailable();
16
-
17
- /**
18
- * Checks if StreamInCallManager should be bypassed because CallKit is handling
19
- * the audio session via CallingX.
20
- *
21
- * On iOS, when CallingX is set up and has a registered call, the audio session
22
- * is managed by CallKit through CallingxImpl.swift.
23
- * In this case, StreamInCallManager should not run to avoid conflicting audio
24
- * session configurations.
25
- */
26
- const shouldBypassForCallKit = ({
27
- isRingingTypeCall,
28
- }: {
29
- isRingingTypeCall: boolean;
30
- }): boolean => {
31
- if (Platform.OS !== 'ios') {
32
- return false;
33
- }
34
- if (!CallingxModule) {
35
- return false;
36
- }
37
- const bypass =
38
- CallingxModule.isSetup &&
39
- (isRingingTypeCall || CallingxModule.isOngoingCallsEnabled);
40
- return bypass;
41
- };
42
-
43
9
  const streamRNVideoSDKGlobals: StreamRNVideoSDKGlobals = {
44
- callingX: {
45
- joinCall: joinCallingxCall,
46
- endCall: endCallingxCall,
47
- registerOutgoingCall: registerOutgoingCall,
48
- },
49
10
  callManager: {
50
- setup: ({ defaultDevice, isRingingTypeCall }) => {
51
- if (shouldBypassForCallKit({ isRingingTypeCall })) {
52
- return;
53
- }
11
+ setup: ({ defaultDevice }) => {
54
12
  StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(
55
13
  defaultDevice,
56
14
  );
57
15
  StreamInCallManagerNativeModule.setup();
58
16
  },
59
- start: ({ isRingingTypeCall }) => {
60
- if (shouldBypassForCallKit({ isRingingTypeCall })) {
61
- return;
62
- }
17
+ start: () => {
63
18
  StreamInCallManagerNativeModule.start();
64
19
  },
65
- stop: ({ isRingingTypeCall }) => {
66
- if (shouldBypassForCallKit({ isRingingTypeCall })) {
67
- return;
68
- }
20
+ stop: () => {
69
21
  StreamInCallManagerNativeModule.stop();
70
22
  },
71
23
  },