@stream-io/video-react-native-sdk 1.29.1-beta.0 → 1.29.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.
Files changed (211) hide show
  1. package/CHANGELOG.md +3133 -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/hooks/push/index.js +2 -0
  9. package/dist/commonjs/hooks/push/index.js.map +1 -1
  10. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +160 -0
  11. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  12. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  13. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  14. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +67 -0
  15. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -0
  16. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +97 -64
  17. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  18. package/dist/commonjs/index.js +0 -1
  19. package/dist/commonjs/index.js.map +1 -1
  20. package/dist/commonjs/modules/call-manager/CallManager.js +0 -26
  21. package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
  22. package/dist/commonjs/providers/StreamCall/index.js +6 -6
  23. package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
  24. package/dist/commonjs/utils/StreamVideoRN/index.js +21 -33
  25. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  26. package/dist/commonjs/utils/internal/registerSDKGlobals.js +3 -52
  27. package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
  28. package/dist/commonjs/utils/push/android.js +202 -155
  29. package/dist/commonjs/utils/push/android.js.map +1 -1
  30. package/dist/commonjs/utils/push/internal/ios.js +34 -17
  31. package/dist/commonjs/utils/push/internal/ios.js.map +1 -1
  32. package/dist/commonjs/utils/push/internal/rxSubjects.js +45 -1
  33. package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -1
  34. package/dist/commonjs/utils/push/internal/utils.js +20 -32
  35. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  36. package/dist/commonjs/utils/push/ios.js.map +1 -1
  37. package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
  38. package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
  39. package/dist/commonjs/utils/push/libs/index.js +19 -8
  40. package/dist/commonjs/utils/push/libs/index.js.map +1 -1
  41. package/dist/commonjs/utils/push/libs/notifee/index.js +19 -0
  42. package/dist/commonjs/utils/push/libs/notifee/index.js.map +1 -1
  43. package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
  44. package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
  45. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js +205 -0
  46. package/dist/commonjs/utils/push/setupIosCallKeepEvents.js.map +1 -0
  47. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
  48. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
  49. package/dist/commonjs/version.js +1 -1
  50. package/dist/commonjs/version.js.map +1 -1
  51. package/dist/module/hooks/push/index.js +2 -0
  52. package/dist/module/hooks/push/index.js.map +1 -1
  53. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +153 -0
  54. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -0
  55. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +31 -18
  56. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  57. package/dist/module/hooks/push/useProcessPushCallEffect.js +60 -0
  58. package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -0
  59. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +99 -66
  60. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  61. package/dist/module/index.js +0 -1
  62. package/dist/module/index.js.map +1 -1
  63. package/dist/module/modules/call-manager/CallManager.js +0 -26
  64. package/dist/module/modules/call-manager/CallManager.js.map +1 -1
  65. package/dist/module/providers/StreamCall/index.js +6 -6
  66. package/dist/module/providers/StreamCall/index.js.map +1 -1
  67. package/dist/module/utils/StreamVideoRN/index.js +21 -33
  68. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  69. package/dist/module/utils/internal/registerSDKGlobals.js +3 -52
  70. package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
  71. package/dist/module/utils/push/android.js +204 -157
  72. package/dist/module/utils/push/android.js.map +1 -1
  73. package/dist/module/utils/push/internal/ios.js +34 -17
  74. package/dist/module/utils/push/internal/ios.js.map +1 -1
  75. package/dist/module/utils/push/internal/rxSubjects.js +44 -0
  76. package/dist/module/utils/push/internal/rxSubjects.js.map +1 -1
  77. package/dist/module/utils/push/internal/utils.js +19 -29
  78. package/dist/module/utils/push/internal/utils.js.map +1 -1
  79. package/dist/module/utils/push/ios.js.map +1 -1
  80. package/dist/module/utils/push/libs/callkeep.js +11 -0
  81. package/dist/module/utils/push/libs/callkeep.js.map +1 -0
  82. package/dist/module/utils/push/libs/index.js +2 -1
  83. package/dist/module/utils/push/libs/index.js.map +1 -1
  84. package/dist/module/utils/push/libs/notifee/index.js +18 -0
  85. package/dist/module/utils/push/libs/notifee/index.js.map +1 -1
  86. package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
  87. package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
  88. package/dist/module/utils/push/setupIosCallKeepEvents.js +199 -0
  89. package/dist/module/utils/push/setupIosCallKeepEvents.js.map +1 -0
  90. package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
  91. package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
  92. package/dist/module/version.js +1 -1
  93. package/dist/module/version.js.map +1 -1
  94. package/dist/typescript/hooks/push/index.d.ts.map +1 -1
  95. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts +5 -0
  96. package/dist/typescript/hooks/push/useIosCallkeepWithCallingStateEffect.d.ts.map +1 -0
  97. package/dist/typescript/hooks/push/useIosVoipPushEventsSetupEffect.d.ts.map +1 -1
  98. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts +8 -0
  99. package/dist/typescript/hooks/push/useProcessPushCallEffect.d.ts.map +1 -0
  100. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  101. package/dist/typescript/index.d.ts +0 -1
  102. package/dist/typescript/index.d.ts.map +1 -1
  103. package/dist/typescript/modules/call-manager/CallManager.d.ts +0 -5
  104. package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
  105. package/dist/typescript/utils/StreamVideoRN/index.d.ts +2 -20
  106. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  107. package/dist/typescript/utils/StreamVideoRN/types.d.ts +29 -54
  108. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  109. package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
  110. package/dist/typescript/utils/push/android.d.ts +2 -1
  111. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  112. package/dist/typescript/utils/push/internal/ios.d.ts.map +1 -1
  113. package/dist/typescript/utils/push/internal/rxSubjects.d.ts +33 -0
  114. package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -1
  115. package/dist/typescript/utils/push/internal/utils.d.ts +1 -8
  116. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  117. package/dist/typescript/utils/push/ios.d.ts +2 -1
  118. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  119. package/dist/typescript/utils/push/libs/callkeep.d.ts +3 -0
  120. package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
  121. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +2 -16
  122. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
  123. package/dist/typescript/utils/push/libs/index.d.ts +2 -1
  124. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
  125. package/dist/typescript/utils/push/libs/notifee/index.d.ts +1 -0
  126. package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +1 -1
  127. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +3 -0
  128. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +1 -0
  129. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts +6 -0
  130. package/dist/typescript/utils/push/setupIosCallKeepEvents.d.ts.map +1 -0
  131. package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
  132. package/dist/typescript/version.d.ts +1 -1
  133. package/dist/typescript/version.d.ts.map +1 -1
  134. package/expo-config-plugin/dist/withAndroidManifest.js +33 -1
  135. package/expo-config-plugin/dist/withAndroidPermissions.js +7 -2
  136. package/expo-config-plugin/dist/withAppDelegate.js +197 -19
  137. package/expo-config-plugin/dist/withMainActivity.js +1 -1
  138. package/expo-config-plugin/dist/withiOSInfoPlist.js +3 -2
  139. package/ios/StreamInCallManager.m +0 -2
  140. package/ios/StreamInCallManager.swift +7 -19
  141. package/ios/StreamVideoReactNative.h +4 -7
  142. package/ios/StreamVideoReactNative.m +82 -189
  143. package/package.json +19 -14
  144. package/src/hooks/push/index.ts +2 -0
  145. package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +235 -0
  146. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +34 -21
  147. package/src/hooks/push/useProcessPushCallEffect.ts +108 -0
  148. package/src/hooks/useAndroidKeepCallAliveEffect.ts +120 -94
  149. package/src/index.ts +0 -1
  150. package/src/modules/call-manager/CallManager.ts +0 -36
  151. package/src/modules/call-manager/native-module.d.ts +0 -7
  152. package/src/providers/StreamCall/index.tsx +6 -6
  153. package/src/utils/StreamVideoRN/index.ts +30 -40
  154. package/src/utils/StreamVideoRN/types.ts +29 -56
  155. package/src/utils/internal/registerSDKGlobals.ts +4 -47
  156. package/src/utils/push/android.ts +309 -231
  157. package/src/utils/push/internal/ios.ts +44 -28
  158. package/src/utils/push/internal/rxSubjects.ts +61 -0
  159. package/src/utils/push/internal/utils.ts +26 -45
  160. package/src/utils/push/ios.ts +6 -1
  161. package/src/utils/push/libs/callkeep.ts +16 -0
  162. package/src/utils/push/libs/index.ts +2 -1
  163. package/src/utils/push/libs/notifee/index.ts +27 -0
  164. package/src/utils/push/libs/voipPushNotification.ts +17 -0
  165. package/src/utils/push/setupIosCallKeepEvents.ts +252 -0
  166. package/src/utils/push/setupIosVoipPushEvents.ts +7 -11
  167. package/src/version.ts +1 -1
  168. package/android/src/main/java/com/streamvideo/reactnative/keepalive/KeepAliveNotification.kt +0 -83
  169. package/android/src/main/java/com/streamvideo/reactnative/keepalive/StreamCallKeepAliveHeadlessService.kt +0 -149
  170. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +0 -121
  171. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  172. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js +0 -58
  173. package/dist/commonjs/utils/internal/callingx/audioSessionPromise.js.map +0 -1
  174. package/dist/commonjs/utils/internal/callingx/callingx.js +0 -109
  175. package/dist/commonjs/utils/internal/callingx/callingx.js.map +0 -1
  176. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js +0 -48
  177. package/dist/commonjs/utils/keepCallAliveHeadlessTask.js.map +0 -1
  178. package/dist/commonjs/utils/push/libs/callingx.js +0 -75
  179. package/dist/commonjs/utils/push/libs/callingx.js.map +0 -1
  180. package/dist/commonjs/utils/push/setupCallingExpEvents.js +0 -108
  181. package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +0 -1
  182. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +0 -114
  183. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +0 -1
  184. package/dist/module/utils/internal/callingx/audioSessionPromise.js +0 -51
  185. package/dist/module/utils/internal/callingx/audioSessionPromise.js.map +0 -1
  186. package/dist/module/utils/internal/callingx/callingx.js +0 -100
  187. package/dist/module/utils/internal/callingx/callingx.js.map +0 -1
  188. package/dist/module/utils/keepCallAliveHeadlessTask.js +0 -42
  189. package/dist/module/utils/keepCallAliveHeadlessTask.js.map +0 -1
  190. package/dist/module/utils/push/libs/callingx.js +0 -67
  191. package/dist/module/utils/push/libs/callingx.js.map +0 -1
  192. package/dist/module/utils/push/setupCallingExpEvents.js +0 -102
  193. package/dist/module/utils/push/setupCallingExpEvents.js.map +0 -1
  194. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts +0 -5
  195. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +0 -1
  196. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts +0 -16
  197. package/dist/typescript/utils/internal/callingx/audioSessionPromise.d.ts.map +0 -1
  198. package/dist/typescript/utils/internal/callingx/callingx.d.ts +0 -13
  199. package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +0 -1
  200. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts +0 -10
  201. package/dist/typescript/utils/keepCallAliveHeadlessTask.d.ts.map +0 -1
  202. package/dist/typescript/utils/push/libs/callingx.d.ts +0 -9
  203. package/dist/typescript/utils/push/libs/callingx.d.ts.map +0 -1
  204. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts +0 -8
  205. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +0 -1
  206. package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +0 -147
  207. package/src/utils/internal/callingx/audioSessionPromise.ts +0 -53
  208. package/src/utils/internal/callingx/callingx.ts +0 -146
  209. package/src/utils/keepCallAliveHeadlessTask.ts +0 -54
  210. package/src/utils/push/libs/callingx.ts +0 -90
  211. package/src/utils/push/setupCallingExpEvents.ts +0 -130
@@ -3,14 +3,9 @@ import pushLogoutCallbacks from '../internal/pushLogoutCallback';
3
3
  import newNotificationCallbacks, {
4
4
  type NewCallNotificationCallback,
5
5
  } from '../internal/newNotificationCallbacks';
6
+ import { setupIosCallKeepEvents } from '../push/setupIosCallKeepEvents';
6
7
  import { setupIosVoipPushEvents } from '../push/setupIosVoipPushEvents';
7
- import { setupCallingExpEvents } from '../push/setupCallingExpEvents';
8
- import {
9
- extractCallingExpOptions,
10
- getCallingxLib,
11
- } from '../push/libs/callingx';
12
8
  import { NativeModules, Platform } from 'react-native';
13
- import { videoLoggerSystem } from '@stream-io/video-client';
14
9
 
15
10
  // Utility type for deep partial
16
11
  type DeepPartial<T> = {
@@ -52,7 +47,10 @@ const DEFAULT_STREAM_VIDEO_CONFIG: StreamVideoConfig = {
52
47
  android: {
53
48
  channel: {
54
49
  id: 'stream_call_foreground_service',
55
- name: 'Ongoing calls',
50
+ name: 'To keep calls alive',
51
+ lights: false,
52
+ vibration: false,
53
+ importance: 3,
56
54
  },
57
55
  notificationTexts: {
58
56
  title: 'Call in progress',
@@ -78,6 +76,20 @@ export class StreamVideoRN {
78
76
  this.config = deepMerge(this.config, updateConfig);
79
77
  }
80
78
 
79
+ static updateAndroidIncomingCallChannel(
80
+ updateChannel: Partial<
81
+ NonNullable<StreamVideoConfig['push']>['android']['incomingCallChannel']
82
+ >,
83
+ ) {
84
+ const prevChannel = this.config.push?.android?.incomingCallChannel;
85
+ if (prevChannel) {
86
+ this.config.push!.android.incomingCallChannel = {
87
+ ...prevChannel,
88
+ ...updateChannel,
89
+ };
90
+ }
91
+ }
92
+
81
93
  /**
82
94
  * Set the push config for StreamVideoRN.
83
95
  * This method must be called **outside** of your application lifecycle, e.g. alongside your
@@ -90,26 +102,7 @@ export class StreamVideoRN {
90
102
  * import App from './App';
91
103
  * // Set push config
92
104
  * const pushConfig = {}; // construct your config
93
- * // Set CallKit/Android Telecom API integration options. All params are optional. If not provided, the default values will be used.
94
- * const callingExpOptions = {
95
- * ios: {
96
- * callsHistory: true,
97
- * displayCallTimeout: 60000,
98
- * sound: 'ringtone',
99
- * imageName: 'callkit_icon',
100
- * },
101
- * android: {
102
- * incomingChannel: {
103
- * id: 'stream_incoming_call_notifications',
104
- * name: 'Call notifications',
105
- * vibration: true,
106
- * sound: 'default',
107
- * },
108
- * titleTransformer: (text: string) => text,
109
- * subtitleTransformer: (text: string) => text,
110
- * },
111
- * };
112
- * StreamVideoRN.setPushConfig(pushConfig, callingExpOptions);
105
+ * StreamVideoRN.setPushConfig(pushConfig);
113
106
  * AppRegistry.registerComponent('app', () => App);
114
107
  */
115
108
  static setPushConfig(pushConfig: NonNullable<StreamVideoConfig['push']>) {
@@ -117,23 +110,20 @@ export class StreamVideoRN {
117
110
  // Ignoring this config as push config was already set
118
111
  return;
119
112
  }
120
-
121
- this.config.push = pushConfig;
122
-
123
- try {
124
- const callingx = getCallingxLib();
125
- videoLoggerSystem
126
- .getLogger('StreamVideoRN.setPushConfig')
127
- .info(JSON.stringify(this.config));
128
- const options = extractCallingExpOptions(this.config);
129
- callingx.setup(options);
130
- } catch {
113
+ if (
114
+ __DEV__ &&
115
+ (pushConfig.navigateAcceptCall || pushConfig.navigateToIncomingCall)
116
+ ) {
131
117
  throw new Error(
132
- 'react-native-callingx library is not installed. Please check the installation instructions: https://getstream.io/video/docs/react-native/incoming-calls/ringing-setup/react-native/.',
118
+ `Support for navigateAcceptCall or navigateToIncomingCall in pushConfig has been removed.
119
+ Please watch for incoming and outgoing calls in the root component of your app.
120
+ Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information.`,
133
121
  );
134
122
  }
135
123
 
136
- setupCallingExpEvents(pushConfig);
124
+ this.config.push = pushConfig;
125
+
126
+ setupIosCallKeepEvents(pushConfig);
137
127
  setupIosVoipPushEvents(pushConfig);
138
128
  }
139
129
 
@@ -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,21 +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;
104
- /**
105
- * The transformer to be used to transform the call title in the notification for ringing and ongoing calls for Android.
106
- */
107
- titleTransformer?: (memberName: string, incoming: boolean) => string;
69
+ incomingCallChannel?: AndroidChannel;
108
70
  /**
109
- * The transformer to be used to transform the call subtitle for ringing and ongoing calls for Android.
71
+ * Functions to create the texts shown in the notification for incoming calls in Android.
72
+ * @example
73
+ * {
74
+ * getTitle: (createdUserName: string) => `Incoming call from ${createdUserName}`,
75
+ * getBody: (createdUserName: string) => `Tap to answer the call`
76
+ * getAcceptButtonTitle?: () => `Accept`,
77
+ * getDeclineButtonTitle?: () => `Decline`,
78
+ * }
110
79
  */
111
- subtitleTransformer?: (call_cid: string, incoming: boolean) => string;
80
+ incomingCallNotificationTextGetters?: {
81
+ getTitle: (createdUserName: string) => string;
82
+ getBody: (createdUserName: string) => string;
83
+ getAcceptButtonTitle?: () => string;
84
+ getDeclineButtonTitle?: () => string;
85
+ };
112
86
  /**
113
87
  * Functions to create the texts shown in the notification for non ringing calls in Android.
114
88
  * @example
@@ -137,16 +111,6 @@ export type StreamVideoConfig = {
137
111
  getBody: (type: NonRingingPushEvent, createdUserName: string) => string;
138
112
  };
139
113
  };
140
- /**
141
- * Whether to enable ongoing calls.
142
- * @default false
143
- */
144
- enableOngoingCalls?: boolean;
145
- /**
146
- * Whether to reject calls when the user is busy.
147
- * @default false
148
- */
149
- shouldRejectCallWhenBusy?: boolean;
150
114
  /**
151
115
  * This function is used to create a custom video client.
152
116
  * This is used create a video client for incoming calls in the background and inform call events to the server.
@@ -166,6 +130,12 @@ export type StreamVideoConfig = {
166
130
  * }
167
131
  */
168
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;
169
139
  /** Callback that is called when a non ringing push notification was tapped */
170
140
  onTapNonRingingCallNotification?: (
171
141
  call_cid: string,
@@ -177,11 +147,14 @@ export type StreamVideoConfig = {
177
147
  /**
178
148
  * The notification channel to keep call alive in the background for Android using a foreground service.
179
149
  */
180
- channel: Omit<AndroidChannelConfig, 'sound' | 'vibration'>;
150
+ channel: AndroidChannel;
181
151
  /**
182
152
  * The texts shown in the notification to keep call alive in the background
183
153
  */
184
- notificationTexts: KeepAliveAndroidNotificationTexts;
154
+ notificationTexts: {
155
+ title: string;
156
+ body: string;
157
+ };
185
158
  /**
186
159
  * The task to run in the foreground service
187
160
  * The task must resolve a promise once complete
@@ -1,66 +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 { endCallingxCall, startCallingxCall } from './callingx/callingx';
5
3
 
6
4
  const StreamInCallManagerNativeModule = NativeModules.StreamInCallManager;
7
5
  const StreamVideoReactNativeModule = NativeModules.StreamVideoReactNative as {
8
6
  checkPermission: StreamRNVideoSDKGlobals['permissions']['check'] | undefined;
9
7
  };
10
8
 
11
- const CallingxModule = getCallingxLibIfAvailable();
12
-
13
- /**
14
- * Checks if StreamInCallManager should be bypassed because CallKit is handling
15
- * the audio session via CallingX.
16
- *
17
- * On iOS, when CallingX is set up and has a registered call, the audio session
18
- * is managed by CallKit through CallingxImpl.swift.
19
- * In this case, StreamInCallManager should not run to avoid conflicting audio
20
- * session configurations.
21
- */
22
- const shouldBypassForCallKit = ({
23
- isRingingTypeCall,
24
- }: {
25
- isRingingTypeCall: boolean;
26
- }): boolean => {
27
- if (Platform.OS !== 'ios') {
28
- return false;
29
- }
30
- if (!CallingxModule) {
31
- return false;
32
- }
33
- const bypass =
34
- CallingxModule.isSetup &&
35
- (isRingingTypeCall || CallingxModule.isOngoingCallsEnabled);
36
- return bypass;
37
- };
38
-
39
9
  const streamRNVideoSDKGlobals: StreamRNVideoSDKGlobals = {
40
- callingX: {
41
- startCall: startCallingxCall,
42
- endCall: endCallingxCall,
43
- },
44
10
  callManager: {
45
- setup: ({ defaultDevice, isRingingTypeCall }) => {
46
- if (shouldBypassForCallKit({ isRingingTypeCall })) {
47
- return;
48
- }
11
+ setup: ({ defaultDevice }) => {
49
12
  StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(
50
13
  defaultDevice,
51
14
  );
52
15
  StreamInCallManagerNativeModule.setup();
53
16
  },
54
- start: ({ isRingingTypeCall }) => {
55
- if (shouldBypassForCallKit({ isRingingTypeCall })) {
56
- return;
57
- }
17
+ start: () => {
58
18
  StreamInCallManagerNativeModule.start();
59
19
  },
60
- stop: ({ isRingingTypeCall }) => {
61
- if (shouldBypassForCallKit({ isRingingTypeCall })) {
62
- return;
63
- }
20
+ stop: () => {
64
21
  StreamInCallManagerNativeModule.stop();
65
22
  },
66
23
  },