@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
@@ -1,10 +1,8 @@
1
1
  import pushLogoutCallbacks from '../internal/pushLogoutCallback';
2
2
  import newNotificationCallbacks from '../internal/newNotificationCallbacks';
3
+ import { setupIosCallKeepEvents } from '../push/setupIosCallKeepEvents';
3
4
  import { setupIosVoipPushEvents } from '../push/setupIosVoipPushEvents';
4
- import { setupCallingExpEvents } from '../push/setupCallingExpEvents';
5
- import { extractCallingExpOptions, getCallingxLib } from '../push/libs/callingx';
6
5
  import { NativeModules, Platform } from 'react-native';
7
- import { videoLoggerSystem } from '@stream-io/video-client';
8
6
 
9
7
  // Utility type for deep partial
10
8
 
@@ -29,7 +27,10 @@ const DEFAULT_STREAM_VIDEO_CONFIG = {
29
27
  android: {
30
28
  channel: {
31
29
  id: 'stream_call_foreground_service',
32
- name: 'Ongoing calls'
30
+ name: 'To keep calls alive',
31
+ lights: false,
32
+ vibration: false,
33
+ importance: 3
33
34
  },
34
35
  notificationTexts: {
35
36
  title: 'Call in progress',
@@ -51,6 +52,15 @@ export class StreamVideoRN {
51
52
  static updateConfig(updateConfig) {
52
53
  this.config = deepMerge(this.config, updateConfig);
53
54
  }
55
+ static updateAndroidIncomingCallChannel(updateChannel) {
56
+ const prevChannel = this.config.push?.android?.incomingCallChannel;
57
+ if (prevChannel) {
58
+ this.config.push.android.incomingCallChannel = {
59
+ ...prevChannel,
60
+ ...updateChannel
61
+ };
62
+ }
63
+ }
54
64
 
55
65
  /**
56
66
  * Set the push config for StreamVideoRN.
@@ -64,28 +74,7 @@ export class StreamVideoRN {
64
74
  * import App from './App';
65
75
  * // Set push config
66
76
  * const pushConfig = {}; // construct your config
67
- * // Set CallKit/Android Telecom API integration options. All params are optional. If not provided, the default values will be used.
68
- * const callingExpOptions = {
69
- * ios: {
70
- * callsHistory: true,
71
- * displayCallTimeout: 60000,
72
- * sound: 'ringtone',
73
- * imageName: 'callkit_icon',
74
- * },
75
- * android: {
76
- * incomingChannel: {
77
- * id: 'stream_incoming_call_notifications',
78
- * name: 'Call notifications',
79
- * vibration: true,
80
- * sound: 'default',
81
- * },
82
- * titleTransformer: (memberName: string, incoming: boolean) =>
83
- * incoming
84
- * ? `${memberName} is calling you`
85
- * : `You are calling ${memberName}`,
86
- * },
87
- * };
88
- * StreamVideoRN.setPushConfig(pushConfig, callingExpOptions);
77
+ * StreamVideoRN.setPushConfig(pushConfig);
89
78
  * AppRegistry.registerComponent('app', () => App);
90
79
  */
91
80
  static setPushConfig(pushConfig) {
@@ -93,16 +82,13 @@ export class StreamVideoRN {
93
82
  // Ignoring this config as push config was already set
94
83
  return;
95
84
  }
96
- this.config.push = pushConfig;
97
- try {
98
- const callingx = getCallingxLib();
99
- videoLoggerSystem.getLogger('StreamVideoRN.setPushConfig').info(JSON.stringify(this.config));
100
- const options = extractCallingExpOptions(this.config);
101
- callingx.setup(options);
102
- } catch {
103
- throw new Error('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/.');
85
+ if (__DEV__ && (pushConfig.navigateAcceptCall || pushConfig.navigateToIncomingCall)) {
86
+ throw new Error(`Support for navigateAcceptCall or navigateToIncomingCall in pushConfig has been removed.
87
+ Please watch for incoming and outgoing calls in the root component of your app.
88
+ Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information.`);
104
89
  }
105
- setupCallingExpEvents(pushConfig);
90
+ this.config.push = pushConfig;
91
+ setupIosCallKeepEvents(pushConfig);
106
92
  setupIosVoipPushEvents(pushConfig);
107
93
  }
108
94
  static getConfig() {
@@ -1 +1 @@
1
- {"version":3,"names":["pushLogoutCallbacks","newNotificationCallbacks","setupIosVoipPushEvents","setupCallingExpEvents","extractCallingExpOptions","getCallingxLib","NativeModules","Platform","videoLoggerSystem","deepMerge","target","source","result","key","undefined","Array","isArray","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","notificationTexts","title","body","taskToRun","Promise","StreamVideoRN","config","busyToneTimeout","updateConfig","setPushConfig","pushConfig","push","callingx","getLogger","info","JSON","stringify","options","setup","Error","getConfig","onPushLogout","current","all","map","callback","then","resolve","clearPushLogoutCallbacks","addOnNewCallNotificationListener","filter","cb","playBusyTone","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","OS","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":"AACA,OAAOA,mBAAmB,MAAM,gCAAgC;AAChE,OAAOC,wBAAwB,MAExB,sCAAsC;AAC7C,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,qBAAqB,QAAQ,+BAA+B;AACrE,SACEC,wBAAwB,EACxBC,cAAc,QACT,uBAAuB;AAC9B,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,iBAAiB,QAAQ,yBAAyB;;AAE3D;;AAKA;AACA,SAASC,SAASA,CAChBC,MAAS,EACTC,MAAsB,EACnB;EACH,MAAMC,MAAM,GAAG;IAAE,GAAGF;EAAO,CAAC;EAE5B,KAAK,MAAMG,GAAG,IAAIF,MAAM,EAAE;IACxB,IAAIA,MAAM,CAACE,GAAG,CAA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AAC;EACjE;AACF","ignoreList":[]}
1
+ {"version":3,"names":["pushLogoutCallbacks","newNotificationCallbacks","setupIosCallKeepEvents","setupIosVoipPushEvents","NativeModules","Platform","deepMerge","target","source","result","key","undefined","Array","isArray","DEFAULT_STREAM_VIDEO_CONFIG","foregroundService","android","channel","id","name","lights","vibration","importance","notificationTexts","title","body","taskToRun","Promise","StreamVideoRN","config","busyToneTimeout","updateConfig","updateAndroidIncomingCallChannel","updateChannel","prevChannel","push","incomingCallChannel","setPushConfig","pushConfig","__DEV__","navigateAcceptCall","navigateToIncomingCall","Error","getConfig","onPushLogout","current","all","map","callback","then","resolve","clearPushLogoutCallbacks","addOnNewCallNotificationListener","filter","cb","playBusyTone","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","OS","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":"AACA,OAAOA,mBAAmB,MAAM,gCAAgC;AAChE,OAAOC,wBAAwB,MAExB,sCAAsC;AAC7C,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;;AAEtD;;AAKA;AACA,SAASC,SAASA,CAChBC,MAAS,EACTC,MAAsB,EACnB;EACH,MAAMC,MAAM,GAAG;IAAE,GAAGF;EAAO,CAAC;EAE5B,KAAK,MAAMG,GAAG,IAAIF,MAAM,EAAE;IACxB,IAAIA,MAAM,CAACE,GAAG,CAAC,KAAKC,SAAS,EAAE;MAC7B,IACE,OAAOH,MAAM,CAACE,GAAG,CAAC,KAAK,QAAQ,IAC/BF,MAAM,CAACE,GAAG,CAAC,KAAK,IAAI,IACpB,CAACE,KAAK,CAACC,OAAO,CAACL,MAAM,CAACE,GAAG,CAAC,CAAC,IAC3B,OAAOH,MAAM,CAACG,GAAG,CAAC,KAAK,QAAQ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,MAAM;MACX/C,wBAAwB,CAAC4C,OAAO,GAC9B5C,wBAAwB,CAAC4C,OAAO,EAAEQ,MAAM,CAAEC,EAAE,IAAKA,EAAE,KAAKN,QAAQ,CAAC;IACrE,CAAC;EACH;;EAEA;AACF;AACA;EACE,aAAaO,YAAYA,CAAA,EAAG;IAC1B,OAAOnD,aAAa,CAACoD,sBAAsB,CAACD,YAAY,CAAC,CAAC;EAC5D;;EAEA;AACF;AACA;EACE,aAAaE,YAAYA,CAAA,EAAG;IAC1B,OAAOrD,aAAa,CAACoD,sBAAsB,CAACC,YAAY,CAAC,CAAC;EAC5D;;EAEA;AACF;AACA;AACA;EACE,aAAaC,6BAA6BA,CAAA,EAAqB;IAC7D,IAAIrD,QAAQ,CAACsD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAIjB,KAAK,CACb,qEACF,CAAC;IACH,OAAOtC,aAAa,CAACoD,sBAAsB,CAACI,sBAAsB,CAAC,CAAC;EACtE;;EAEA;AACF;AACA;AACA;EACE,aAAaC,4BAA4BA,CAAA,EAAqB;IAC5D,IAAIxD,QAAQ,CAACsD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAIjB,KAAK,CACb,oEACF,CAAC;IACH,OAAOtC,aAAa,CAACoD,sBAAsB,CAACM,qBAAqB,CAAC,CAAC;EACrE;;EAEA;AACF;AACA;AACA;EACE,aAAaC,wBAAwBA,CAAA,EAAqB;IACxD,IAAI1D,QAAQ,CAACsD,EAAE,KAAK,SAAS,EAC3B,MAAM,IAAIjB,KAAK,CACb,gEACF,CAAC;IACH,OAAOtC,aAAa,CAACoD,sBAAsB,CAACQ,iBAAiB,CAAC,CAAC;EACjE;AACF","ignoreList":[]}
@@ -1,68 +1,18 @@
1
1
  import { NativeModules, PermissionsAndroid, Platform } from 'react-native';
2
- import { getCallingxLibIfAvailable } from '../push/libs/callingx';
3
- import { endCallingxCall, registerOutgoingCall, joinCallingxCall } from './callingx/callingx';
4
2
  const StreamInCallManagerNativeModule = NativeModules.StreamInCallManager;
5
3
  const StreamVideoReactNativeModule = NativeModules.StreamVideoReactNative;
6
- const CallingxModule = getCallingxLibIfAvailable();
7
-
8
- /**
9
- * Checks if StreamInCallManager should be bypassed because CallKit is handling
10
- * the audio session via CallingX.
11
- *
12
- * On iOS, when CallingX is set up and has a registered call, the audio session
13
- * is managed by CallKit through CallingxImpl.swift.
14
- * In this case, StreamInCallManager should not run to avoid conflicting audio
15
- * session configurations.
16
- */
17
- const shouldBypassForCallKit = ({
18
- isRingingTypeCall
19
- }) => {
20
- if (Platform.OS !== 'ios') {
21
- return false;
22
- }
23
- if (!CallingxModule) {
24
- return false;
25
- }
26
- const bypass = CallingxModule.isSetup && (isRingingTypeCall || CallingxModule.isOngoingCallsEnabled);
27
- return bypass;
28
- };
29
4
  const streamRNVideoSDKGlobals = {
30
- callingX: {
31
- joinCall: joinCallingxCall,
32
- endCall: endCallingxCall,
33
- registerOutgoingCall: registerOutgoingCall
34
- },
35
5
  callManager: {
36
6
  setup: ({
37
- defaultDevice,
38
- isRingingTypeCall
7
+ defaultDevice
39
8
  }) => {
40
- if (shouldBypassForCallKit({
41
- isRingingTypeCall
42
- })) {
43
- return;
44
- }
45
9
  StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice);
46
10
  StreamInCallManagerNativeModule.setup();
47
11
  },
48
- start: ({
49
- isRingingTypeCall
50
- }) => {
51
- if (shouldBypassForCallKit({
52
- isRingingTypeCall
53
- })) {
54
- return;
55
- }
12
+ start: () => {
56
13
  StreamInCallManagerNativeModule.start();
57
14
  },
58
- stop: ({
59
- isRingingTypeCall
60
- }) => {
61
- if (shouldBypassForCallKit({
62
- isRingingTypeCall
63
- })) {
64
- return;
65
- }
15
+ stop: () => {
66
16
  StreamInCallManagerNativeModule.stop();
67
17
  }
68
18
  },
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","PermissionsAndroid","Platform","getCallingxLibIfAvailable","endCallingxCall","registerOutgoingCall","joinCallingxCall","StreamInCallManagerNativeModule","StreamInCallManager","StreamVideoReactNativeModule","StreamVideoReactNative","CallingxModule","shouldBypassForCallKit","isRingingTypeCall","OS","bypass","isSetup","isOngoingCallsEnabled","streamRNVideoSDKGlobals","callingX","joinCall","endCall","callManager","setup","defaultDevice","setDefaultAudioDeviceEndpointType","start","stop","permissions","check","permission","nativeAndroidPermission","PERMISSIONS","CAMERA","RECORD_AUDIO","Boolean","checkPermission","registerSDKGlobals","global","streamRNVideoSDK"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":"AACA,SAASA,aAAa,EAAEC,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAC1E,SAASC,yBAAyB,QAAQ,uBAAuB;AACjE,SACEC,eAAe,EACfC,oBAAoB,EACpBC,gBAAgB,QACX,qBAAqB;AAE5B,MAAMC,+BAA+B,GAAGP,aAAa,CAACQ,mBAAmB;AACzE,MAAMC,4BAA4B,GAAGT,aAAa,CAACU,sBAElD;AAED,MAAMC,cAAc,GAAGR,yBAAyB,CAAC,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMS,sBAAsB,GAAGA,CAAC;EAC9BC;AAGF,CAAC,KAAc;EACb,IAAIX,QAAQ,CAACY,EAAE,KAAK,KAAK,EAAE;IACzB,OAAO,KAAK;EACd;EACA,IAAI,CAACH,cAAc,EAAE;IACnB,OAAO,KAAK;EACd;EACA,MAAMI,MAAM,GACVJ,cAAc,CAACK,OAAO,KACrBH,iBAAiB,IAAIF,cAAc,CAACM,qBAAqB,CAAC;EAC7D,OAAOF,MAAM;AACf,CAAC;AAED,MAAMG,uBAAgD,GAAG;EACvDC,QAAQ,EAAE;IACRC,QAAQ,EAAEd,gBAAgB;IAC1Be,OAAO,EAAEjB,eAAe;IACxBC,oBAAoB,EAAEA;EACxB,CAAC;EACDiB,WAAW,EAAE;IACXC,KAAK,EAAEA,CAAC;MAAEC,aAAa;MAAEX;IAAkB,CAAC,KAAK;MAC/C,IAAID,sBAAsB,CAAC;QAAEC;MAAkB,CAAC,CAAC,EAAE;QACjD;MACF;MACAN,+BAA+B,CAACkB,iCAAiC,CAC/DD,aACF,CAAC;MACDjB,+BAA+B,CAACgB,KAAK,CAAC,CAAC;IACzC,CAAC;IACDG,KAAK,EAAEA,CAAC;MAAEb;IAAkB,CAAC,KAAK;MAChC,IAAID,sBAAsB,CAAC;QAAEC;MAAkB,CAAC,CAAC,EAAE;QACjD;MACF;MACAN,+BAA+B,CAACmB,KAAK,CAAC,CAAC;IACzC,CAAC;IACDC,IAAI,EAAEA,CAAC;MAAEd;IAAkB,CAAC,KAAK;MAC/B,IAAID,sBAAsB,CAAC;QAAEC;MAAkB,CAAC,CAAC,EAAE;QACjD;MACF;MACAN,+BAA+B,CAACoB,IAAI,CAAC,CAAC;IACxC;EACF,CAAC;EACDC,WAAW,EAAE;IACXC,KAAK,EAAE,MAAOC,UAAU,IAAK;MAC3B,IAAI5B,QAAQ,CAACY,EAAE,KAAK,SAAS,EAAE;QAC7B,MAAMiB,uBAAuB,GAC3BD,UAAU,KAAK,QAAQ,GACnB7B,kBAAkB,CAAC+B,WAAW,CAACC,MAAM,GACrChC,kBAAkB,CAAC+B,WAAW,CAACE,YAAY;QACjD,OAAOjC,kBAAkB,CAAC4B,KAAK,CAACE,uBAAuB,CAAC;MAC1D;;MAEA;MACA,OAAOI,OAAO,CACZ,MAAM1B,4BAA4B,CAAC2B,eAAe,GAAGN,UAAU,CACjE,CAAC;IACH;EACF;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,SAASO,kBAAkBA,CAAA,EAAG;EACnC,IAAI,CAACC,MAAM,CAACC,gBAAgB,EAAE;IAC5BD,MAAM,CAACC,gBAAgB,GAAGrB,uBAAuB;EACnD;AACF","ignoreList":[]}
1
+ {"version":3,"names":["NativeModules","PermissionsAndroid","Platform","StreamInCallManagerNativeModule","StreamInCallManager","StreamVideoReactNativeModule","StreamVideoReactNative","streamRNVideoSDKGlobals","callManager","setup","defaultDevice","setDefaultAudioDeviceEndpointType","start","stop","permissions","check","permission","OS","nativeAndroidPermission","PERMISSIONS","CAMERA","RECORD_AUDIO","Boolean","checkPermission","registerSDKGlobals","global","streamRNVideoSDK"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":"AACA,SAASA,aAAa,EAAEC,kBAAkB,EAAEC,QAAQ,QAAQ,cAAc;AAE1E,MAAMC,+BAA+B,GAAGH,aAAa,CAACI,mBAAmB;AACzE,MAAMC,4BAA4B,GAAGL,aAAa,CAACM,sBAElD;AAED,MAAMC,uBAAgD,GAAG;EACvDC,WAAW,EAAE;IACXC,KAAK,EAAEA,CAAC;MAAEC;IAAc,CAAC,KAAK;MAC5BP,+BAA+B,CAACQ,iCAAiC,CAC/DD,aACF,CAAC;MACDP,+BAA+B,CAACM,KAAK,CAAC,CAAC;IACzC,CAAC;IACDG,KAAK,EAAEA,CAAA,KAAM;MACXT,+BAA+B,CAACS,KAAK,CAAC,CAAC;IACzC,CAAC;IACDC,IAAI,EAAEA,CAAA,KAAM;MACVV,+BAA+B,CAACU,IAAI,CAAC,CAAC;IACxC;EACF,CAAC;EACDC,WAAW,EAAE;IACXC,KAAK,EAAE,MAAOC,UAAU,IAAK;MAC3B,IAAId,QAAQ,CAACe,EAAE,KAAK,SAAS,EAAE;QAC7B,MAAMC,uBAAuB,GAC3BF,UAAU,KAAK,QAAQ,GACnBf,kBAAkB,CAACkB,WAAW,CAACC,MAAM,GACrCnB,kBAAkB,CAACkB,WAAW,CAACE,YAAY;QACjD,OAAOpB,kBAAkB,CAACc,KAAK,CAACG,uBAAuB,CAAC;MAC1D;;MAEA;MACA,OAAOI,OAAO,CACZ,MAAMjB,4BAA4B,CAACkB,eAAe,GAAGP,UAAU,CACjE,CAAC;IACH;EACF;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,SAASQ,kBAAkBA,CAAA,EAAG;EACnC,IAAI,CAACC,MAAM,CAACC,gBAAgB,EAAE;IAC5BD,MAAM,CAACC,gBAAgB,GAAGnB,uBAAuB;EACnD;AACF","ignoreList":[]}
@@ -1,12 +1,14 @@
1
1
  import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
2
2
  import { AppState, Platform } from 'react-native';
3
- import { getExpoNotificationsLib, getExpoNotificationsLibNoThrow, getFirebaseMessagingLib, getFirebaseMessagingLibNoThrow, getNotifeeLibThrowIfNotInstalledForPush } from './libs';
4
- import { pushNonRingingCallData$ } from './internal/rxSubjects';
3
+ import { getExpoNotificationsLib, getExpoNotificationsLibNoThrow, getFirebaseMessagingLib, getFirebaseMessagingLibNoThrow, getIncomingCallForegroundServiceTypes, getNotifeeLibThrowIfNotInstalledForPush } from './libs';
4
+ import { pushAcceptedIncomingCallCId$, pushAndroidBackgroundDeliveredIncomingCallCId$, pushNonRingingCallData$, pushRejectedIncomingCallCId$, pushTappedIncomingCallCId$ } from './internal/rxSubjects';
5
5
  import { pushUnsubscriptionCallbacks } from './internal/constants';
6
- import { canListenToWS, shouldCallBeClosed } from './internal/utils';
6
+ import { canAddPushWSSubscriptionsRef, clearPushWSEventSubscriptions, processCallFromPushInBackground, shouldCallBeEnded } from './internal/utils';
7
7
  import { setPushLogoutCallback } from '../internal/pushLogoutCallback';
8
+ import { getAndroidDefaultRingtoneUrl } from '../getAndroidDefaultRingtoneUrl';
8
9
  import { StreamVideoRN } from '../StreamVideoRN';
9
- import { getCallingxLib } from './libs/callingx';
10
+ const ACCEPT_CALL_ACTION_ID = 'accept';
11
+ const DECLINE_CALL_ACTION_ID = 'decline';
10
12
  let lastFirebaseToken = {
11
13
  token: '',
12
14
  userId: ''
@@ -61,7 +63,8 @@ export async function initAndroidPushToken(client, pushConfig, setUnsubscribeLis
61
63
  await setDeviceToken(token);
62
64
  }
63
65
  }
64
- const messaging = pushConfig.isExpo ? getFirebaseMessagingLibNoThrow(true) : getFirebaseMessagingLib();
66
+ // TODO: remove the incomingCallChannel check and find a better way once we have telecom integration for android
67
+ const messaging = pushConfig.isExpo && !pushConfig.android.incomingCallChannel ? getFirebaseMessagingLibNoThrow(true) : getFirebaseMessagingLib();
65
68
  if (messaging) {
66
69
  logger.debug(`setting firebase token listeners`);
67
70
  const unsubscribe = messaging().onTokenRefresh(refreshedToken => setDeviceToken(refreshedToken));
@@ -75,8 +78,8 @@ export async function initAndroidPushToken(client, pushConfig, setUnsubscribeLis
75
78
  * Creates notification from the push message data.
76
79
  * For Ringing and Non-Ringing calls.
77
80
  */
78
-
79
81
  export const firebaseDataHandler = async data => {
82
+ if (Platform.OS !== 'android') return;
80
83
  /* Example data from firebase
81
84
  "message": {
82
85
  "data": {
@@ -92,155 +95,174 @@ export const firebaseDataHandler = async data => {
92
95
  // other stuff
93
96
  }
94
97
  */
95
- if (Platform.OS !== 'android') return;
96
- const logger = videoLoggerSystem.getLogger('firebaseDataHandler');
97
98
  const pushConfig = StreamVideoRN.getConfig().push;
98
99
  if (!pushConfig || !data || data.sender !== 'stream.video') {
99
100
  return;
100
101
  }
102
+ const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
103
+ const notifee = notifeeLib.default;
104
+ const settings = await notifee.getNotificationSettings();
105
+ if (settings.authorizationStatus !== 1) {
106
+ const logger = videoLoggerSystem.getLogger('firebaseDataHandler');
107
+ logger.debug(`Notification permission not granted, unable to post ${data.type} notifications`);
108
+ return;
109
+ }
101
110
  if (data.type === 'call.ring') {
102
111
  const call_cid = data.call_cid;
103
- const callingx = getCallingxLib();
104
- const client = await pushConfig.createStreamVideoClient();
105
- if (!client) {
106
- logger.debug(`video client not found, skipping the call.ring notification`);
107
- await callingx.stopService();
108
- return;
109
- }
112
+ const created_by_id = data.created_by_id;
113
+ const receiver_id = data.receiver_id;
114
+ const video_client = await pushConfig.createStreamVideoClient();
115
+ await video_client?.onRingingCall(call_cid);
116
+ const shouldCallBeClosed = callToCheck => {
117
+ const {
118
+ mustEndCall
119
+ } = shouldCallBeEnded(callToCheck, created_by_id, receiver_id);
120
+ return mustEndCall;
121
+ };
122
+ const canListenToWS = () => canAddPushWSSubscriptionsRef.current && AppState.currentState !== 'active';
110
123
  const asForegroundService = canListenToWS();
111
124
  if (asForegroundService) {
112
125
  // Listen to call events from WS through fg service
113
126
  // note: this will replace the current empty fg service runner
114
- //we need to start service (e.g. by calling display incoming call) and than launch bg task, consider making those steps independent
115
- await callingx.startBackgroundTask((_, stopTask) => {
116
- return new Promise(resolve => {
117
- const finishBackgroundTask = () => {
118
- callingx.log(`Finishing background task for callCid: ${call_cid}`, 'debug');
119
- resolve(undefined);
120
- stopTask();
121
- };
122
- (async () => {
123
- try {
124
- const _client = await pushConfig.createStreamVideoClient();
125
- if (!_client) {
126
- logger.debug(`Closing fg service as there is no client to create from push config`);
127
- finishBackgroundTask();
128
- return;
129
- }
130
- const callFromPush = await _client.onRingingCall(call_cid);
131
- const {
132
- mustEndCall,
133
- endCallReason
134
- } = shouldCallBeClosed(callFromPush, data);
135
- if (mustEndCall) {
136
- logger.debug(`Closing fg service callCid: ${call_cid} endCallReason: ${endCallReason}`);
137
- callingx.log(`Ending call with callCid: ${call_cid} endCallReason: ${endCallReason}`, 'debug');
138
- callingx.endCallWithReason(call_cid, endCallReason);
139
- resolve(undefined);
140
- return;
141
- }
142
- const unsubscribeFunctions = [];
143
- // check if service needs to be closed if accept/decline event was done on another device
144
- const unsubscribe = callFromPush.on('all', event => {
145
- const _canListenToWS = canListenToWS();
146
- if (!_canListenToWS) {
147
- logger.debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, {
148
- event
149
- });
150
- unsubscribeFunctions.forEach(fn => fn());
151
- finishBackgroundTask();
152
- return;
153
- }
154
- const {
155
- mustEndCall: mustEndCallFromEvent,
156
- endCallReason: endCallReasonFromEvent
157
- } = shouldCallBeClosed(callFromPush, data);
158
- if (mustEndCallFromEvent) {
159
- logger.debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed`, {
160
- event
161
- });
162
- unsubscribeFunctions.forEach(fn => fn());
163
- callingx.endCallWithReason(call_cid, endCallReasonFromEvent);
164
- resolve(undefined);
165
- }
127
+ notifee.registerForegroundService(() => {
128
+ return new Promise(async () => {
129
+ const client = await pushConfig.createStreamVideoClient();
130
+ if (!client) {
131
+ videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service as there is no client to create from push config`);
132
+ notifee.stopForegroundService();
133
+ return;
134
+ }
135
+ const callFromPush = await client.onRingingCall(call_cid);
136
+ let _shouldCallBeClosed = shouldCallBeClosed(callFromPush);
137
+ if (_shouldCallBeClosed) {
138
+ videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service callCid: ${call_cid} shouldCallBeClosed: ${_shouldCallBeClosed}`);
139
+ notifee.stopForegroundService();
140
+ return;
141
+ }
142
+ const unsubscribeFunctions = [];
143
+ // check if service needs to be closed if accept/decline event was done on another device
144
+ const unsubscribe = callFromPush.on('all', event => {
145
+ const _canListenToWS = canListenToWS();
146
+ if (!_canListenToWS) {
147
+ videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, {
148
+ event
166
149
  });
167
-
168
- // check if service needs to be closed if call was left
169
- const stateSubscription = callFromPush.state.callingState$.subscribe(callingState => {
170
- if (callingState === CallingState.IDLE || callingState === CallingState.LEFT) {
171
- logger.debug(`Closing fg service from callingState callCid: ${call_cid} callingState: ${callingState}`);
172
- unsubscribeFunctions.forEach(fn => fn());
173
- callingx.log(`Ending call with callCid: ${call_cid} callingState: ${callingState}`, 'debug');
174
- resolve(undefined);
175
- }
176
- });
177
- const endCallSubscription = callingx.addEventListener('endCall', async ({
178
- callId
179
- }) => {
180
- unsubscribeFunctions.forEach(fn => fn());
181
- try {
182
- await callFromPush.leave({
183
- reject: callFromPush.state.callingState === CallingState.RINGING,
184
- reason: 'decline'
185
- });
186
- } catch (error) {
187
- logger.error(`Failed to leave call with callCid: ${call_cid} error: ${error}`);
188
- } finally {
189
- callingx.log(`Ending call with callCid: ${call_cid} callId: ${callId}`, 'debug');
190
- resolve(undefined);
191
- }
192
- });
193
-
194
- //stop background task when app comes to foreground
195
- const appStateSubscription = AppState.addEventListener('change', nextAppState => {
196
- const _canListenToWS = canListenToWS();
197
- callingx.log(`AppState changed to: ${nextAppState} for callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, 'debug');
198
- if (!_canListenToWS) {
199
- unsubscribeFunctions.forEach(fn => fn());
200
- finishBackgroundTask();
201
- return;
202
- }
150
+ unsubscribeFunctions.forEach(fn => fn());
151
+ notifee.stopForegroundService();
152
+ return;
153
+ }
154
+ _shouldCallBeClosed = shouldCallBeClosed(callFromPush);
155
+ if (_shouldCallBeClosed) {
156
+ videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed: ${_shouldCallBeClosed}`, {
157
+ event
203
158
  });
204
- unsubscribeFunctions.push(unsubscribe);
205
- unsubscribeFunctions.push(() => stateSubscription.unsubscribe());
206
- unsubscribeFunctions.push(() => endCallSubscription.remove());
207
- unsubscribeFunctions.push(() => appStateSubscription.remove());
208
- pushUnsubscriptionCallbacks.get(call_cid)?.forEach(cb => cb());
209
- pushUnsubscriptionCallbacks.set(call_cid, unsubscribeFunctions);
210
- } catch (error) {
211
- callingx.log(`Failed to start background task with callCid: ${call_cid} error: ${error}`, 'error');
212
- finishBackgroundTask();
159
+ unsubscribeFunctions.forEach(fn => fn());
160
+ notifee.stopForegroundService();
161
+ }
162
+ });
163
+ // check if service needs to be closed if call was left
164
+ const subscription = callFromPush.state.callingState$.subscribe(callingState => {
165
+ if (callingState === CallingState.IDLE || callingState === CallingState.LEFT) {
166
+ videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service from callingState callCid: ${call_cid} callingState: ${callingState}`);
167
+ unsubscribeFunctions.forEach(fn => fn());
168
+ notifee.stopForegroundService();
213
169
  }
214
- })();
170
+ });
171
+ unsubscribeFunctions.push(unsubscribe);
172
+ unsubscribeFunctions.push(() => subscription.unsubscribe());
173
+ pushUnsubscriptionCallbacks.get(call_cid)?.forEach(cb => cb());
174
+ pushUnsubscriptionCallbacks.set(call_cid, unsubscribeFunctions);
215
175
  });
216
176
  });
217
177
  }
178
+ const incomingCallChannel = pushConfig.android.incomingCallChannel;
179
+ const incomingCallNotificationTextGetters = pushConfig.android.incomingCallNotificationTextGetters;
180
+ if (!incomingCallChannel || !incomingCallNotificationTextGetters) {
181
+ const logger = videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler');
182
+ logger.error("Can't show incoming call notification as either or both incomingCallChannel and incomingCallNotificationTextGetters were not provided");
183
+ return;
184
+ }
185
+ /*
186
+ * Sound has to be set on channel level for android 8 and above and cant be updated later after creation!
187
+ * For android 7 and below, sound should be set on notification level
188
+ */
189
+ // set default ringtone if not provided
190
+ if (!incomingCallChannel.sound) {
191
+ incomingCallChannel.sound = await getAndroidDefaultRingtoneUrl();
192
+ }
193
+ await notifee.createChannel(incomingCallChannel);
194
+ const {
195
+ getTitle,
196
+ getBody,
197
+ getAcceptButtonTitle,
198
+ getDeclineButtonTitle
199
+ } = incomingCallNotificationTextGetters;
200
+ const createdUserName = data.created_by_display_name;
201
+ const title = getTitle(createdUserName);
202
+ const body = getBody(createdUserName);
203
+ videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Displaying incoming call notification with callCid: ${call_cid} title: ${title} body: ${body} asForegroundService: ${asForegroundService}`);
204
+ const channelId = incomingCallChannel.id;
205
+ await notifee.displayNotification({
206
+ id: call_cid,
207
+ title: getTitle(createdUserName),
208
+ body: getBody(createdUserName),
209
+ data,
210
+ android: {
211
+ channelId,
212
+ smallIcon: pushConfig.android.smallIcon,
213
+ importance: 4,
214
+ // high importance
215
+ foregroundServiceTypes: getIncomingCallForegroundServiceTypes(),
216
+ asForegroundService,
217
+ ongoing: true,
218
+ sound: incomingCallChannel.sound,
219
+ vibrationPattern: incomingCallChannel.vibrationPattern,
220
+ loopSound: true,
221
+ pressAction: {
222
+ id: 'default',
223
+ launchActivity: 'default' // open the app when the notification is pressed
224
+ },
225
+ actions: [{
226
+ title: getDeclineButtonTitle?.() ?? 'Decline',
227
+ pressAction: {
228
+ id: DECLINE_CALL_ACTION_ID
229
+ }
230
+ }, {
231
+ title: getAcceptButtonTitle?.() ?? 'Accept',
232
+ pressAction: {
233
+ id: ACCEPT_CALL_ACTION_ID,
234
+ launchActivity: 'default' // open the app when the notification is pressed
235
+ }
236
+ }],
237
+ category: notifeeLib.AndroidCategory.CALL,
238
+ fullScreenAction: {
239
+ id: 'stream_ringing_incoming_call'
240
+ },
241
+ timeoutAfter: 60000 // 60 seconds, after which the notification will be dismissed automatically
242
+ }
243
+ });
218
244
  if (asForegroundService) {
219
245
  // no need to check if call has be closed as that will be handled by the fg service
220
246
  return;
221
247
  }
248
+
249
+ // check if call needs to be closed if accept/decline event was done
250
+ // before the notification was shown
251
+ const client = await pushConfig.createStreamVideoClient();
252
+ if (!client) {
253
+ return;
254
+ }
222
255
  const callFromPush = await client.onRingingCall(call_cid);
223
- const {
224
- mustEndCall,
225
- endCallReason
226
- } = shouldCallBeClosed(callFromPush, data);
227
- if (mustEndCall) {
228
- logger.debug(`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`);
229
- callingx.endCallWithReason(call_cid, endCallReason);
256
+ if (shouldCallBeClosed(callFromPush)) {
257
+ videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`);
258
+ notifee.cancelDisplayedNotification(call_cid);
230
259
  }
231
260
  } else {
232
- const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
233
- const notifee = notifeeLib.default;
234
- const settings = await notifee.getNotificationSettings();
235
- if (settings.authorizationStatus !== 1) {
236
- logger.debug(`Notification permission not granted, unable to post ${data.type} notifications`);
237
- return;
238
- }
239
-
240
261
  // the other types are call.live_started and call.notification
241
262
  const callChannel = pushConfig.android.callChannel;
242
263
  const callNotificationTextGetters = pushConfig.android.callNotificationTextGetters;
243
264
  if (!callChannel || !callNotificationTextGetters) {
265
+ const logger = videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler');
244
266
  logger.debug("Can't show call notification as either or both callChannel and callNotificationTextGetters is not provided");
245
267
  return;
246
268
  }
@@ -255,10 +277,10 @@ export const firebaseDataHandler = async data => {
255
277
  const type = data.type;
256
278
  const title = getTitle(type, createdUserName);
257
279
  const body = getBody(type, createdUserName);
258
- logger.debug(`Displaying NonRingingPushEvent ${type} notification with title: ${title} body: ${body}`);
280
+ videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Displaying NonRingingPushEvent ${type} notification with title: ${title} body: ${body}`);
259
281
  await notifee.displayNotification({
260
- title,
261
- body,
282
+ title: getTitle(type, createdUserName),
283
+ body: getBody(type, createdUserName),
262
284
  data,
263
285
  android: {
264
286
  sound: callChannel.sound,
@@ -282,7 +304,8 @@ export const firebaseDataHandler = async data => {
282
304
  }
283
305
  };
284
306
  export const onAndroidNotifeeEvent = async ({
285
- event
307
+ event,
308
+ isBackground
286
309
  }) => {
287
310
  if (Platform.OS !== 'android') return;
288
311
  const {
@@ -290,7 +313,8 @@ export const onAndroidNotifeeEvent = async ({
290
313
  detail
291
314
  } = event;
292
315
  const {
293
- notification
316
+ notification,
317
+ pressAction
294
318
  } = detail;
295
319
  const notificationId = notification?.id;
296
320
  const data = notification?.data;
@@ -301,10 +325,53 @@ export const onAndroidNotifeeEvent = async ({
301
325
 
302
326
  // we can safely cast to string because the data is from "stream.video"
303
327
  const call_cid = data.call_cid;
304
- const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
305
- if (type === notifeeLib.EventType.PRESS) {
306
- videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`onTapNonRingingCallNotification with callCId: ${call_cid}`);
307
- pushConfig.onTapNonRingingCallNotification?.(call_cid, data.type);
328
+ if (data.type === 'call.ring') {
329
+ // check if we have observers for the call cid (this means the app is in the foreground state)
330
+ const hasObservers = pushAcceptedIncomingCallCId$.observed && pushRejectedIncomingCallCId$.observed;
331
+ const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
332
+ const notifee = notifeeLib.default;
333
+ // Check if we need to decline the call
334
+ const didPressDecline = type === notifeeLib.EventType.ACTION_PRESS && pressAction?.id === DECLINE_CALL_ACTION_ID;
335
+ const didDismiss = type === notifeeLib.EventType.DISMISSED;
336
+ const mustDecline = didPressDecline || didDismiss;
337
+ // Check if we need to accept the call
338
+ const mustAccept = type === notifeeLib.EventType.ACTION_PRESS && pressAction?.id === ACCEPT_CALL_ACTION_ID;
339
+ if (mustAccept || mustDecline || type === notifeeLib.EventType.ACTION_PRESS) {
340
+ videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`clearPushWSEventSubscriptions for callCId: ${call_cid} mustAccept: ${mustAccept} mustDecline: ${mustDecline}`);
341
+ clearPushWSEventSubscriptions(call_cid);
342
+ notifee.stopForegroundService();
343
+ }
344
+ if (mustAccept) {
345
+ videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushAcceptedIncomingCallCId$ added with callCId: ${call_cid}`);
346
+ pushAcceptedIncomingCallCId$.next(call_cid);
347
+ // NOTE: accept will be handled by the app with rxjs observers as the app will go to foreground always
348
+ } else if (mustDecline) {
349
+ videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushRejectedIncomingCallCId$ added with callCId: ${call_cid}`);
350
+ pushRejectedIncomingCallCId$.next(call_cid);
351
+ if (hasObservers) {
352
+ // if we had observers we can return here as the observers will handle the call as the app is in the foreground state
353
+ videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`Skipped processCallFromPushInBackground for Declining call with callCId: ${call_cid} as the app is in the foreground state`);
354
+ return;
355
+ }
356
+ videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`start processCallFromPushInBackground - Declining call with callCId: ${call_cid}`);
357
+ await processCallFromPushInBackground(pushConfig, call_cid, 'decline');
358
+ } else {
359
+ if (type === notifeeLib.EventType.PRESS) {
360
+ videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushTappedIncomingCallCId$ added with callCId: ${call_cid}`);
361
+ pushTappedIncomingCallCId$.next(call_cid);
362
+ // pressed state will be handled by the app with rxjs observers as the app will go to foreground always
363
+ } else if (isBackground && type === notifeeLib.EventType.DELIVERED) {
364
+ videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushAndroidBackgroundDeliveredIncomingCallCId$ added with callCId: ${call_cid}`);
365
+ pushAndroidBackgroundDeliveredIncomingCallCId$.next(call_cid);
366
+ // background delivered state will be handled by the app with rxjs observers as processing needs to happen only when app is opened
367
+ }
368
+ }
369
+ } else {
370
+ const notifeeLib = getNotifeeLibThrowIfNotInstalledForPush();
371
+ if (type === notifeeLib.EventType.PRESS) {
372
+ videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`onTapNonRingingCallNotification with callCId: ${call_cid}`);
373
+ pushConfig.onTapNonRingingCallNotification?.(call_cid, data.type);
374
+ }
308
375
  }
309
376
  };
310
377
  //# sourceMappingURL=android.js.map