@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
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.StreamVideoRN = void 0;
7
7
  var _pushLogoutCallback = _interopRequireDefault(require("../internal/pushLogoutCallback"));
8
8
  var _newNotificationCallbacks = _interopRequireDefault(require("../internal/newNotificationCallbacks"));
9
+ var _setupIosCallKeepEvents = require("../push/setupIosCallKeepEvents");
9
10
  var _setupIosVoipPushEvents = require("../push/setupIosVoipPushEvents");
10
- var _setupCallingExpEvents = require("../push/setupCallingExpEvents");
11
- var _callingx = require("../push/libs/callingx");
12
11
  var _reactNative = require("react-native");
13
- var _videoClient = require("@stream-io/video-client");
14
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
13
  // Utility type for deep partial
16
14
 
@@ -35,7 +33,10 @@ const DEFAULT_STREAM_VIDEO_CONFIG = {
35
33
  android: {
36
34
  channel: {
37
35
  id: 'stream_call_foreground_service',
38
- name: 'Ongoing calls'
36
+ name: 'To keep calls alive',
37
+ lights: false,
38
+ vibration: false,
39
+ importance: 3
39
40
  },
40
41
  notificationTexts: {
41
42
  title: 'Call in progress',
@@ -57,6 +58,15 @@ class StreamVideoRN {
57
58
  static updateConfig(updateConfig) {
58
59
  this.config = deepMerge(this.config, updateConfig);
59
60
  }
61
+ static updateAndroidIncomingCallChannel(updateChannel) {
62
+ const prevChannel = this.config.push?.android?.incomingCallChannel;
63
+ if (prevChannel) {
64
+ this.config.push.android.incomingCallChannel = {
65
+ ...prevChannel,
66
+ ...updateChannel
67
+ };
68
+ }
69
+ }
60
70
 
61
71
  /**
62
72
  * Set the push config for StreamVideoRN.
@@ -70,26 +80,7 @@ class StreamVideoRN {
70
80
  * import App from './App';
71
81
  * // Set push config
72
82
  * const pushConfig = {}; // construct your config
73
- * // Set CallKit/Android Telecom API integration options. All params are optional. If not provided, the default values will be used.
74
- * const callingExpOptions = {
75
- * ios: {
76
- * callsHistory: true,
77
- * displayCallTimeout: 60000,
78
- * sound: 'ringtone',
79
- * imageName: 'callkit_icon',
80
- * },
81
- * android: {
82
- * incomingChannel: {
83
- * id: 'stream_incoming_call_notifications',
84
- * name: 'Call notifications',
85
- * vibration: true,
86
- * sound: 'default',
87
- * },
88
- * titleTransformer: (text: string) => text,
89
- * subtitleTransformer: (text: string) => text,
90
- * },
91
- * };
92
- * StreamVideoRN.setPushConfig(pushConfig, callingExpOptions);
83
+ * StreamVideoRN.setPushConfig(pushConfig);
93
84
  * AppRegistry.registerComponent('app', () => App);
94
85
  */
95
86
  static setPushConfig(pushConfig) {
@@ -97,16 +88,13 @@ class StreamVideoRN {
97
88
  // Ignoring this config as push config was already set
98
89
  return;
99
90
  }
100
- this.config.push = pushConfig;
101
- try {
102
- const callingx = (0, _callingx.getCallingxLib)();
103
- _videoClient.videoLoggerSystem.getLogger('StreamVideoRN.setPushConfig').info(JSON.stringify(this.config));
104
- const options = (0, _callingx.extractCallingExpOptions)(this.config);
105
- callingx.setup(options);
106
- } catch {
107
- 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/.');
91
+ if (__DEV__ && (pushConfig.navigateAcceptCall || pushConfig.navigateToIncomingCall)) {
92
+ throw new Error(`Support for navigateAcceptCall or navigateToIncomingCall in pushConfig has been removed.
93
+ Please watch for incoming and outgoing calls in the root component of your app.
94
+ Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information.`);
108
95
  }
109
- (0, _setupCallingExpEvents.setupCallingExpEvents)(pushConfig);
96
+ this.config.push = pushConfig;
97
+ (0, _setupIosCallKeepEvents.setupIosCallKeepEvents)(pushConfig);
110
98
  (0, _setupIosVoipPushEvents.setupIosVoipPushEvents)(pushConfig);
111
99
  }
112
100
  static getConfig() {
@@ -1 +1 @@
1
- {"version":3,"names":["_pushLogoutCallback","_interopRequireDefault","require","_newNotificationCallbacks","_setupIosVoipPushEvents","_setupCallingExpEvents","_callingx","_reactNative","_videoClient","e","__esModule","default","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","getCallingxLib","videoLoggerSystem","getLogger","info","JSON","stringify","options","extractCallingExpOptions","setup","Error","setupCallingExpEvents","setupIosVoipPushEvents","getConfig","onPushLogout","pushLogoutCallbacks","current","all","map","callback","then","resolve","clearPushLogoutCallbacks","addOnNewCallNotificationListener","newNotificationCallbacks","filter","cb","playBusyTone","NativeModules","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","Platform","OS","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware","exports"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAIA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAA4D,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5D;;AAKA;AACA,SAASG,SAASA,CAChBC,MAAS,EACTC,MAAsB,EACnB;EACH,MAAMC,MAAM,GAAG;IAAE,GAAGF;EAAO,CAAC;EAE5B,KAAK,MAAMG,GAAG,IAAIF,MAA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iBAAiB,CAAC,CAAC;EACjE;AACF;AAACC,OAAA,CAAA9C,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_pushLogoutCallback","_interopRequireDefault","require","_newNotificationCallbacks","_setupIosCallKeepEvents","_setupIosVoipPushEvents","_reactNative","e","__esModule","default","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","setupIosCallKeepEvents","setupIosVoipPushEvents","getConfig","onPushLogout","pushLogoutCallbacks","current","all","map","callback","then","resolve","clearPushLogoutCallbacks","addOnNewCallNotificationListener","newNotificationCallbacks","filter","cb","playBusyTone","NativeModules","StreamVideoReactNative","stopBusyTone","androidHasAudioOutputHardware","Platform","OS","hasAudioOutputHardware","androidHasMicrophoneHardware","hasMicrophoneHardware","androidHasCameraHardware","hasCameraHardware","exports"],"sourceRoot":"../../../../src","sources":["utils/StreamVideoRN/index.ts"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA,IAAAE,uBAAA,GAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAAuD,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEvD;;AAKA;AACA,SAASG,SAASA,CAChBC,MAAS,EACTC,MAAsB,EACnB;EACH,MAAMC,MAAM,GAAG;IAAE,GAAGF;EAAO,CAAC;EAE5B,KAAK,MAAMG,GAAG,IAAIF,MAAM,EAAE;IACxB,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AAsB,CAACS,iBAAiB,CAAC,CAAC;EACjE;AACF;AAACC,OAAA,CAAA3C,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -5,69 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.registerSDKGlobals = registerSDKGlobals;
7
7
  var _reactNative = require("react-native");
8
- var _callingx = require("../push/libs/callingx");
9
- var _callingx2 = require("./callingx/callingx");
10
8
  const StreamInCallManagerNativeModule = _reactNative.NativeModules.StreamInCallManager;
11
9
  const StreamVideoReactNativeModule = _reactNative.NativeModules.StreamVideoReactNative;
12
- const CallingxModule = (0, _callingx.getCallingxLibIfAvailable)();
13
-
14
- /**
15
- * Checks if StreamInCallManager should be bypassed because CallKit is handling
16
- * the audio session via CallingX.
17
- *
18
- * On iOS, when CallingX is set up and has a registered call, the audio session
19
- * is managed by CallKit through CallingxImpl.swift.
20
- * In this case, StreamInCallManager should not run to avoid conflicting audio
21
- * session configurations.
22
- */
23
- const shouldBypassForCallKit = ({
24
- isRingingTypeCall
25
- }) => {
26
- if (_reactNative.Platform.OS !== 'ios') {
27
- return false;
28
- }
29
- if (!CallingxModule) {
30
- return false;
31
- }
32
- const bypass = CallingxModule.isSetup && (isRingingTypeCall || CallingxModule.isOngoingCallsEnabled);
33
- return bypass;
34
- };
35
10
  const streamRNVideoSDKGlobals = {
36
- callingX: {
37
- startCall: _callingx2.startCallingxCall,
38
- endCall: _callingx2.endCallingxCall
39
- },
40
11
  callManager: {
41
12
  setup: ({
42
- defaultDevice,
43
- isRingingTypeCall
13
+ defaultDevice
44
14
  }) => {
45
- if (shouldBypassForCallKit({
46
- isRingingTypeCall
47
- })) {
48
- return;
49
- }
50
15
  StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice);
51
16
  StreamInCallManagerNativeModule.setup();
52
17
  },
53
- start: ({
54
- isRingingTypeCall
55
- }) => {
56
- if (shouldBypassForCallKit({
57
- isRingingTypeCall
58
- })) {
59
- return;
60
- }
18
+ start: () => {
61
19
  StreamInCallManagerNativeModule.start();
62
20
  },
63
- stop: ({
64
- isRingingTypeCall
65
- }) => {
66
- if (shouldBypassForCallKit({
67
- isRingingTypeCall
68
- })) {
69
- return;
70
- }
21
+ stop: () => {
71
22
  StreamInCallManagerNativeModule.stop();
72
23
  }
73
24
  },
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_callingx","_callingx2","StreamInCallManagerNativeModule","NativeModules","StreamInCallManager","StreamVideoReactNativeModule","StreamVideoReactNative","CallingxModule","getCallingxLibIfAvailable","shouldBypassForCallKit","isRingingTypeCall","Platform","OS","bypass","isSetup","isOngoingCallsEnabled","streamRNVideoSDKGlobals","callingX","startCall","startCallingxCall","endCall","endCallingxCall","callManager","setup","defaultDevice","setDefaultAudioDeviceEndpointType","start","stop","permissions","check","permission","nativeAndroidPermission","PermissionsAndroid","PERMISSIONS","CAMERA","RECORD_AUDIO","Boolean","checkPermission","registerSDKGlobals","global","streamRNVideoSDK"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA,MAAMG,+BAA+B,GAAGC,0BAAa,CAACC,mBAAmB;AACzE,MAAMC,4BAA4B,GAAGF,0BAAa,CAACG,sBAElD;AAED,MAAMC,cAAc,GAAG,IAAAC,mCAAyB,EAAC,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAGA,CAAC;EAC9BC;AAGF,CAAC,KAAc;EACb,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,OAAO,KAAK;EACd;EACA,IAAI,CAACL,cAAc,EAAE;IACnB,OAAO,KAAK;EACd;EACA,MAAMM,MAAM,GACVN,cAAc,CAACO,OAAO,KACrBJ,iBAAiB,IAAIH,cAAc,CAACQ,qBAAqB,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AAM,CAACC,gBAAgB,EAAE;IAC5BD,MAAM,CAACC,gBAAgB,GAAGxB,uBAAuB;EACnD;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","StreamInCallManagerNativeModule","NativeModules","StreamInCallManager","StreamVideoReactNativeModule","StreamVideoReactNative","streamRNVideoSDKGlobals","callManager","setup","defaultDevice","setDefaultAudioDeviceEndpointType","start","stop","permissions","check","permission","Platform","OS","nativeAndroidPermission","PermissionsAndroid","PERMISSIONS","CAMERA","RECORD_AUDIO","Boolean","checkPermission","registerSDKGlobals","global","streamRNVideoSDK"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,+BAA+B,GAAGC,0BAAa,CAACC,mBAAmB;AACzE,MAAMC,4BAA4B,GAAGF,0BAAa,CAACG,sBAElD;AAED,MAAMC,uBAAgD,GAAG;EACvDC,WAAW,EAAE;IACXC,KAAK,EAAEA,CAAC;MAAEC;IAAc,CAAC,KAAK;MAC5BR,+BAA+B,CAACS,iCAAiC,CAC/DD,aACF,CAAC;MACDR,+BAA+B,CAACO,KAAK,CAAC,CAAC;IACzC,CAAC;IACDG,KAAK,EAAEA,CAAA,KAAM;MACXV,+BAA+B,CAACU,KAAK,CAAC,CAAC;IACzC,CAAC;IACDC,IAAI,EAAEA,CAAA,KAAM;MACVX,+BAA+B,CAACW,IAAI,CAAC,CAAC;IACxC;EACF,CAAC;EACDC,WAAW,EAAE;IACXC,KAAK,EAAE,MAAOC,UAAU,IAAK;MAC3B,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE;QAC7B,MAAMC,uBAAuB,GAC3BH,UAAU,KAAK,QAAQ,GACnBI,+BAAkB,CAACC,WAAW,CAACC,MAAM,GACrCF,+BAAkB,CAACC,WAAW,CAACE,YAAY;QACjD,OAAOH,+BAAkB,CAACL,KAAK,CAACI,uBAAuB,CAAC;MAC1D;;MAEA;MACA,OAAOK,OAAO,CACZ,MAAMnB,4BAA4B,CAACoB,eAAe,GAAGT,UAAU,CACjE,CAAC;IACH;EACF;AACF,CAAC;;AAED;AACA;AACA;AACO,SAASU,kBAAkBA,CAAA,EAAG;EACnC,IAAI,CAACC,MAAM,CAACC,gBAAgB,EAAE;IAC5BD,MAAM,CAACC,gBAAgB,GAAGrB,uBAAuB;EACnD;AACF","ignoreList":[]}
@@ -13,8 +13,10 @@ var _rxSubjects = require("./internal/rxSubjects");
13
13
  var _constants = require("./internal/constants");
14
14
  var _utils = require("./internal/utils");
15
15
  var _pushLogoutCallback = require("../internal/pushLogoutCallback");
16
+ var _getAndroidDefaultRingtoneUrl = require("../getAndroidDefaultRingtoneUrl");
16
17
  var _StreamVideoRN = require("../StreamVideoRN");
17
- var _callingx = require("./libs/callingx");
18
+ const ACCEPT_CALL_ACTION_ID = 'accept';
19
+ const DECLINE_CALL_ACTION_ID = 'decline';
18
20
  let lastFirebaseToken = {
19
21
  token: '',
20
22
  userId: ''
@@ -69,7 +71,8 @@ async function initAndroidPushToken(client, pushConfig, setUnsubscribeListener)
69
71
  await setDeviceToken(token);
70
72
  }
71
73
  }
72
- const messaging = pushConfig.isExpo ? (0, _libs.getFirebaseMessagingLibNoThrow)(true) : (0, _libs.getFirebaseMessagingLib)();
74
+ // TODO: remove the incomingCallChannel check and find a better way once we have telecom integration for android
75
+ const messaging = pushConfig.isExpo && !pushConfig.android.incomingCallChannel ? (0, _libs.getFirebaseMessagingLibNoThrow)(true) : (0, _libs.getFirebaseMessagingLib)();
73
76
  if (messaging) {
74
77
  logger.debug(`setting firebase token listeners`);
75
78
  const unsubscribe = messaging().onTokenRefresh(refreshedToken => setDeviceToken(refreshedToken));
@@ -83,8 +86,8 @@ async function initAndroidPushToken(client, pushConfig, setUnsubscribeListener)
83
86
  * Creates notification from the push message data.
84
87
  * For Ringing and Non-Ringing calls.
85
88
  */
86
-
87
89
  const firebaseDataHandler = async data => {
90
+ if (_reactNative.Platform.OS !== 'android') return;
88
91
  /* Example data from firebase
89
92
  "message": {
90
93
  "data": {
@@ -100,175 +103,174 @@ const firebaseDataHandler = async data => {
100
103
  // other stuff
101
104
  }
102
105
  */
103
- if (_reactNative.Platform.OS !== 'android') return;
104
- const logger = _videoClient.videoLoggerSystem.getLogger('firebaseDataHandler');
105
106
  const pushConfig = _StreamVideoRN.StreamVideoRN.getConfig().push;
106
107
  if (!pushConfig || !data || data.sender !== 'stream.video') {
107
108
  return;
108
109
  }
110
+ const notifeeLib = (0, _libs.getNotifeeLibThrowIfNotInstalledForPush)();
111
+ const notifee = notifeeLib.default;
112
+ const settings = await notifee.getNotificationSettings();
113
+ if (settings.authorizationStatus !== 1) {
114
+ const logger = _videoClient.videoLoggerSystem.getLogger('firebaseDataHandler');
115
+ logger.debug(`Notification permission not granted, unable to post ${data.type} notifications`);
116
+ return;
117
+ }
109
118
  if (data.type === 'call.ring') {
110
119
  const call_cid = data.call_cid;
111
- if (!call_cid) {
112
- logger.debug(`call_cid is not provided, skipping the call.ring notification`);
113
- return;
114
- }
115
- const callingx = (0, _callingx.getCallingxLib)();
116
- if (!callingx.canPostNotifications) {
117
- logger.warn(`Cannot post notifications, skipping the call.ring notification`);
118
- return;
119
- }
120
- const client = await pushConfig.createStreamVideoClient();
121
- if (!client) {
122
- logger.debug(`video client not found, skipping the call.ring notification`);
123
- return;
124
- }
125
- const shouldRejectCallWhenBusy = client['rejectCallWhenBusy'] ?? false;
126
- if (callingx.hasRegisteredCall() && shouldRejectCallWhenBusy) {
127
- logger.debug(`registered call found, skipping the call.ring notification`);
128
- return;
129
- }
130
- const asForegroundService = (0, _utils.canListenToWS)();
131
- const callerName = data.created_by_display_name;
132
- const hasVideo = data.video === 'true';
120
+ const created_by_id = data.created_by_id;
121
+ const receiver_id = data.receiver_id;
122
+ const video_client = await pushConfig.createStreamVideoClient();
123
+ await video_client?.onRingingCall(call_cid);
124
+ const shouldCallBeClosed = callToCheck => {
125
+ const {
126
+ mustEndCall
127
+ } = (0, _utils.shouldCallBeEnded)(callToCheck, created_by_id, receiver_id);
128
+ return mustEndCall;
129
+ };
130
+ const canListenToWS = () => _utils.canAddPushWSSubscriptionsRef.current && _reactNative.AppState.currentState !== 'active';
131
+ const asForegroundService = canListenToWS();
133
132
  if (asForegroundService) {
134
133
  // Listen to call events from WS through fg service
135
134
  // note: this will replace the current empty fg service runner
136
- //we need to start service (e.g. by calling display incoming call) and than launch bg task, consider making those steps independent
137
- callingx.registerBackgroundTask((_, stopTask) => {
138
- return new Promise(resolve => {
139
- const finishBackgroundTask = () => {
140
- callingx.log(`Finishing background task for callCid: ${call_cid}`, 'debug');
141
- resolve(undefined);
142
- stopTask();
143
- };
144
- (async () => {
145
- try {
146
- const _client = await pushConfig.createStreamVideoClient();
147
- if (!_client) {
148
- logger.debug(`Closing fg service as there is no client to create from push config`);
149
- finishBackgroundTask();
150
- return;
151
- }
152
- const callFromPush = await _client.onRingingCall(call_cid);
153
- const {
154
- mustEndCall,
155
- endCallReason
156
- } = (0, _utils.shouldCallBeClosed)(callFromPush, data);
157
- if (mustEndCall) {
158
- logger.debug(`Closing fg service callCid: ${call_cid} endCallReason: ${endCallReason}`);
159
- finishBackgroundTask();
160
- callingx.log(`Ending call with callCid: ${call_cid} endCallReason: ${endCallReason}`, 'debug');
161
- callingx.endCallWithReason(call_cid, endCallReason);
162
- return;
163
- }
164
- const unsubscribeFunctions = [];
165
- // check if service needs to be closed if accept/decline event was done on another device
166
- const unsubscribe = callFromPush.on('all', event => {
167
- const _canListenToWS = (0, _utils.canListenToWS)();
168
- if (!_canListenToWS) {
169
- logger.debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, {
170
- event
171
- });
172
- unsubscribeFunctions.forEach(fn => fn());
173
- finishBackgroundTask();
174
- return;
175
- }
176
- const {
177
- mustEndCall: mustEndCallFromEvent,
178
- endCallReason: endCallReasonFromEvent
179
- } = (0, _utils.shouldCallBeClosed)(callFromPush, data);
180
- if (mustEndCallFromEvent) {
181
- logger.debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed`, {
182
- event
183
- });
184
- unsubscribeFunctions.forEach(fn => fn());
185
- finishBackgroundTask();
186
- callingx.endCallWithReason(call_cid, endCallReasonFromEvent);
187
- }
135
+ notifee.registerForegroundService(() => {
136
+ return new Promise(async () => {
137
+ const client = await pushConfig.createStreamVideoClient();
138
+ if (!client) {
139
+ _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service as there is no client to create from push config`);
140
+ notifee.stopForegroundService();
141
+ return;
142
+ }
143
+ const callFromPush = await client.onRingingCall(call_cid);
144
+ let _shouldCallBeClosed = shouldCallBeClosed(callFromPush);
145
+ if (_shouldCallBeClosed) {
146
+ _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service callCid: ${call_cid} shouldCallBeClosed: ${_shouldCallBeClosed}`);
147
+ notifee.stopForegroundService();
148
+ return;
149
+ }
150
+ const unsubscribeFunctions = [];
151
+ // check if service needs to be closed if accept/decline event was done on another device
152
+ const unsubscribe = callFromPush.on('all', event => {
153
+ const _canListenToWS = canListenToWS();
154
+ if (!_canListenToWS) {
155
+ _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, {
156
+ event
188
157
  });
189
-
190
- // check if service needs to be closed if call was left
191
- const stateSubscription = callFromPush.state.callingState$.subscribe(callingState => {
192
- if (callingState === _videoClient.CallingState.IDLE || callingState === _videoClient.CallingState.LEFT) {
193
- logger.debug(`Closing fg service from callingState callCid: ${call_cid} callingState: ${callingState}`);
194
- unsubscribeFunctions.forEach(fn => fn());
195
-
196
- //TODO: think about sending appropriate reason for end call
197
- callingx.log(`Ending call with callCid: ${call_cid} callingState: ${callingState}`, 'debug');
198
- finishBackgroundTask();
199
- callingx.endCallWithReason(call_cid, 'remote');
200
- }
201
- });
202
- const endCallSubscription = callingx.addEventListener('endCall', async ({
203
- callId
204
- }) => {
205
- unsubscribeFunctions.forEach(fn => fn());
206
- try {
207
- await callFromPush.leave({
208
- reject: true,
209
- reason: 'decline'
210
- });
211
- } catch (error) {
212
- logger.error(`Failed to leave call with callCid: ${call_cid} error: ${error}`);
213
- } finally {
214
- callingx.log(`Ending call with callCid: ${call_cid} callId: ${callId}`, 'debug');
215
- finishBackgroundTask();
216
- callingx.endCallWithReason(callId, 'rejected');
217
- }
218
- });
219
-
220
- //stop background task when app comes to foreground
221
- const appStateSubscription = _reactNative.AppState.addEventListener('change', nextAppState => {
222
- const _canListenToWS = (0, _utils.canListenToWS)();
223
- callingx.log(`AppState changed to: ${nextAppState} for callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, 'debug');
224
- if (!_canListenToWS) {
225
- unsubscribeFunctions.forEach(fn => fn());
226
- finishBackgroundTask();
227
- return;
228
- }
158
+ unsubscribeFunctions.forEach(fn => fn());
159
+ notifee.stopForegroundService();
160
+ return;
161
+ }
162
+ _shouldCallBeClosed = shouldCallBeClosed(callFromPush);
163
+ if (_shouldCallBeClosed) {
164
+ _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed: ${_shouldCallBeClosed}`, {
165
+ event
229
166
  });
230
- unsubscribeFunctions.push(unsubscribe);
231
- unsubscribeFunctions.push(() => stateSubscription.unsubscribe());
232
- unsubscribeFunctions.push(() => endCallSubscription.remove());
233
- unsubscribeFunctions.push(() => appStateSubscription.remove());
234
- _constants.pushUnsubscriptionCallbacks.get(call_cid)?.forEach(cb => cb());
235
- _constants.pushUnsubscriptionCallbacks.set(call_cid, unsubscribeFunctions);
236
- } catch (error) {
237
- callingx.log(`Failed to start background task with callCid: ${call_cid} error: ${error}`, 'error');
238
- finishBackgroundTask();
167
+ unsubscribeFunctions.forEach(fn => fn());
168
+ notifee.stopForegroundService();
169
+ }
170
+ });
171
+ // check if service needs to be closed if call was left
172
+ const subscription = callFromPush.state.callingState$.subscribe(callingState => {
173
+ if (callingState === _videoClient.CallingState.IDLE || callingState === _videoClient.CallingState.LEFT) {
174
+ _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Closing fg service from callingState callCid: ${call_cid} callingState: ${callingState}`);
175
+ unsubscribeFunctions.forEach(fn => fn());
176
+ notifee.stopForegroundService();
239
177
  }
240
- })();
178
+ });
179
+ unsubscribeFunctions.push(unsubscribe);
180
+ unsubscribeFunctions.push(() => subscription.unsubscribe());
181
+ _constants.pushUnsubscriptionCallbacks.get(call_cid)?.forEach(cb => cb());
182
+ _constants.pushUnsubscriptionCallbacks.set(call_cid, unsubscribeFunctions);
241
183
  });
242
184
  });
243
185
  }
244
- await callingx.displayIncomingCall(call_cid, call_cid, callerName, hasVideo);
245
- logger.debug(`Displaying incoming call notification with callCid: ${call_cid} asForegroundService: ${asForegroundService}`);
186
+ const incomingCallChannel = pushConfig.android.incomingCallChannel;
187
+ const incomingCallNotificationTextGetters = pushConfig.android.incomingCallNotificationTextGetters;
188
+ if (!incomingCallChannel || !incomingCallNotificationTextGetters) {
189
+ const logger = _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler');
190
+ logger.error("Can't show incoming call notification as either or both incomingCallChannel and incomingCallNotificationTextGetters were not provided");
191
+ return;
192
+ }
193
+ /*
194
+ * Sound has to be set on channel level for android 8 and above and cant be updated later after creation!
195
+ * For android 7 and below, sound should be set on notification level
196
+ */
197
+ // set default ringtone if not provided
198
+ if (!incomingCallChannel.sound) {
199
+ incomingCallChannel.sound = await (0, _getAndroidDefaultRingtoneUrl.getAndroidDefaultRingtoneUrl)();
200
+ }
201
+ await notifee.createChannel(incomingCallChannel);
202
+ const {
203
+ getTitle,
204
+ getBody,
205
+ getAcceptButtonTitle,
206
+ getDeclineButtonTitle
207
+ } = incomingCallNotificationTextGetters;
208
+ const createdUserName = data.created_by_display_name;
209
+ const title = getTitle(createdUserName);
210
+ const body = getBody(createdUserName);
211
+ _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Displaying incoming call notification with callCid: ${call_cid} title: ${title} body: ${body} asForegroundService: ${asForegroundService}`);
212
+ const channelId = incomingCallChannel.id;
213
+ await notifee.displayNotification({
214
+ id: call_cid,
215
+ title: getTitle(createdUserName),
216
+ body: getBody(createdUserName),
217
+ data,
218
+ android: {
219
+ channelId,
220
+ smallIcon: pushConfig.android.smallIcon,
221
+ importance: 4,
222
+ // high importance
223
+ foregroundServiceTypes: (0, _libs.getIncomingCallForegroundServiceTypes)(),
224
+ asForegroundService,
225
+ ongoing: true,
226
+ sound: incomingCallChannel.sound,
227
+ vibrationPattern: incomingCallChannel.vibrationPattern,
228
+ loopSound: true,
229
+ pressAction: {
230
+ id: 'default',
231
+ launchActivity: 'default' // open the app when the notification is pressed
232
+ },
233
+ actions: [{
234
+ title: getDeclineButtonTitle?.() ?? 'Decline',
235
+ pressAction: {
236
+ id: DECLINE_CALL_ACTION_ID
237
+ }
238
+ }, {
239
+ title: getAcceptButtonTitle?.() ?? 'Accept',
240
+ pressAction: {
241
+ id: ACCEPT_CALL_ACTION_ID,
242
+ launchActivity: 'default' // open the app when the notification is pressed
243
+ }
244
+ }],
245
+ category: notifeeLib.AndroidCategory.CALL,
246
+ fullScreenAction: {
247
+ id: 'stream_ringing_incoming_call'
248
+ },
249
+ timeoutAfter: 60000 // 60 seconds, after which the notification will be dismissed automatically
250
+ }
251
+ });
246
252
  if (asForegroundService) {
247
253
  // no need to check if call has be closed as that will be handled by the fg service
248
254
  return;
249
255
  }
256
+
257
+ // check if call needs to be closed if accept/decline event was done
258
+ // before the notification was shown
259
+ const client = await pushConfig.createStreamVideoClient();
260
+ if (!client) {
261
+ return;
262
+ }
250
263
  const callFromPush = await client.onRingingCall(call_cid);
251
- const {
252
- mustEndCall,
253
- endCallReason
254
- } = (0, _utils.shouldCallBeClosed)(callFromPush, data);
255
- if (mustEndCall) {
256
- logger.debug(`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`);
257
- callingx.endCallWithReason(call_cid, endCallReason);
264
+ if (shouldCallBeClosed(callFromPush)) {
265
+ _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`);
266
+ notifee.cancelDisplayedNotification(call_cid);
258
267
  }
259
268
  } else {
260
- const notifeeLib = (0, _libs.getNotifeeLibThrowIfNotInstalledForPush)();
261
- const notifee = notifeeLib.default;
262
- const settings = await notifee.getNotificationSettings();
263
- if (settings.authorizationStatus !== 1) {
264
- logger.debug(`Notification permission not granted, unable to post ${data.type} notifications`);
265
- return;
266
- }
267
-
268
269
  // the other types are call.live_started and call.notification
269
270
  const callChannel = pushConfig.android.callChannel;
270
271
  const callNotificationTextGetters = pushConfig.android.callNotificationTextGetters;
271
272
  if (!callChannel || !callNotificationTextGetters) {
273
+ const logger = _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler');
272
274
  logger.debug("Can't show call notification as either or both callChannel and callNotificationTextGetters is not provided");
273
275
  return;
274
276
  }
@@ -283,10 +285,10 @@ const firebaseDataHandler = async data => {
283
285
  const type = data.type;
284
286
  const title = getTitle(type, createdUserName);
285
287
  const body = getBody(type, createdUserName);
286
- logger.debug(`Displaying NonRingingPushEvent ${type} notification with title: ${title} body: ${body}`);
288
+ _videoClient.videoLoggerSystem.getLogger('firebaseMessagingOnMessageHandler').debug(`Displaying NonRingingPushEvent ${type} notification with title: ${title} body: ${body}`);
287
289
  await notifee.displayNotification({
288
- title,
289
- body,
290
+ title: getTitle(type, createdUserName),
291
+ body: getBody(type, createdUserName),
290
292
  data,
291
293
  android: {
292
294
  sound: callChannel.sound,
@@ -311,7 +313,8 @@ const firebaseDataHandler = async data => {
311
313
  };
312
314
  exports.firebaseDataHandler = firebaseDataHandler;
313
315
  const onAndroidNotifeeEvent = async ({
314
- event
316
+ event,
317
+ isBackground
315
318
  }) => {
316
319
  if (_reactNative.Platform.OS !== 'android') return;
317
320
  const {
@@ -319,7 +322,8 @@ const onAndroidNotifeeEvent = async ({
319
322
  detail
320
323
  } = event;
321
324
  const {
322
- notification
325
+ notification,
326
+ pressAction
323
327
  } = detail;
324
328
  const notificationId = notification?.id;
325
329
  const data = notification?.data;
@@ -330,10 +334,53 @@ const onAndroidNotifeeEvent = async ({
330
334
 
331
335
  // we can safely cast to string because the data is from "stream.video"
332
336
  const call_cid = data.call_cid;
333
- const notifeeLib = (0, _libs.getNotifeeLibThrowIfNotInstalledForPush)();
334
- if (type === notifeeLib.EventType.PRESS) {
335
- _videoClient.videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`onTapNonRingingCallNotification with callCId: ${call_cid}`);
336
- pushConfig.onTapNonRingingCallNotification?.(call_cid, data.type);
337
+ if (data.type === 'call.ring') {
338
+ // check if we have observers for the call cid (this means the app is in the foreground state)
339
+ const hasObservers = _rxSubjects.pushAcceptedIncomingCallCId$.observed && _rxSubjects.pushRejectedIncomingCallCId$.observed;
340
+ const notifeeLib = (0, _libs.getNotifeeLibThrowIfNotInstalledForPush)();
341
+ const notifee = notifeeLib.default;
342
+ // Check if we need to decline the call
343
+ const didPressDecline = type === notifeeLib.EventType.ACTION_PRESS && pressAction?.id === DECLINE_CALL_ACTION_ID;
344
+ const didDismiss = type === notifeeLib.EventType.DISMISSED;
345
+ const mustDecline = didPressDecline || didDismiss;
346
+ // Check if we need to accept the call
347
+ const mustAccept = type === notifeeLib.EventType.ACTION_PRESS && pressAction?.id === ACCEPT_CALL_ACTION_ID;
348
+ if (mustAccept || mustDecline || type === notifeeLib.EventType.ACTION_PRESS) {
349
+ _videoClient.videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`clearPushWSEventSubscriptions for callCId: ${call_cid} mustAccept: ${mustAccept} mustDecline: ${mustDecline}`);
350
+ (0, _utils.clearPushWSEventSubscriptions)(call_cid);
351
+ notifee.stopForegroundService();
352
+ }
353
+ if (mustAccept) {
354
+ _videoClient.videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushAcceptedIncomingCallCId$ added with callCId: ${call_cid}`);
355
+ _rxSubjects.pushAcceptedIncomingCallCId$.next(call_cid);
356
+ // NOTE: accept will be handled by the app with rxjs observers as the app will go to foreground always
357
+ } else if (mustDecline) {
358
+ _videoClient.videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushRejectedIncomingCallCId$ added with callCId: ${call_cid}`);
359
+ _rxSubjects.pushRejectedIncomingCallCId$.next(call_cid);
360
+ if (hasObservers) {
361
+ // if we had observers we can return here as the observers will handle the call as the app is in the foreground state
362
+ _videoClient.videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`Skipped processCallFromPushInBackground for Declining call with callCId: ${call_cid} as the app is in the foreground state`);
363
+ return;
364
+ }
365
+ _videoClient.videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`start processCallFromPushInBackground - Declining call with callCId: ${call_cid}`);
366
+ await (0, _utils.processCallFromPushInBackground)(pushConfig, call_cid, 'decline');
367
+ } else {
368
+ if (type === notifeeLib.EventType.PRESS) {
369
+ _videoClient.videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushTappedIncomingCallCId$ added with callCId: ${call_cid}`);
370
+ _rxSubjects.pushTappedIncomingCallCId$.next(call_cid);
371
+ // pressed state will be handled by the app with rxjs observers as the app will go to foreground always
372
+ } else if (isBackground && type === notifeeLib.EventType.DELIVERED) {
373
+ _videoClient.videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`pushAndroidBackgroundDeliveredIncomingCallCId$ added with callCId: ${call_cid}`);
374
+ _rxSubjects.pushAndroidBackgroundDeliveredIncomingCallCId$.next(call_cid);
375
+ // background delivered state will be handled by the app with rxjs observers as processing needs to happen only when app is opened
376
+ }
377
+ }
378
+ } else {
379
+ const notifeeLib = (0, _libs.getNotifeeLibThrowIfNotInstalledForPush)();
380
+ if (type === notifeeLib.EventType.PRESS) {
381
+ _videoClient.videoLoggerSystem.getLogger('onAndroidNotifeeEvent').debug(`onTapNonRingingCallNotification with callCId: ${call_cid}`);
382
+ pushConfig.onTapNonRingingCallNotification?.(call_cid, data.type);
383
+ }
337
384
  }
338
385
  };
339
386
  exports.onAndroidNotifeeEvent = onAndroidNotifeeEvent;