@stream-io/video-react-native-sdk 1.34.0 → 1.36.0

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 (184) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js +9 -2
  3. package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
  4. package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js +9 -2
  5. package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
  6. package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js +11 -12
  7. package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
  8. package/dist/commonjs/components/Call/RingingCallContent/TextBasedIndicator.js +7 -2
  9. package/dist/commonjs/components/Call/RingingCallContent/TextBasedIndicator.js.map +1 -1
  10. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js +7 -3
  11. package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -1
  12. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +1 -1
  13. package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
  14. package/dist/commonjs/hooks/push/index.js +0 -4
  15. package/dist/commonjs/hooks/push/index.js.map +1 -1
  16. package/dist/commonjs/modules/call-manager/CallManager.js +6 -0
  17. package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
  18. package/dist/commonjs/utils/StreamVideoRN/index.js +0 -17
  19. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  20. package/dist/commonjs/utils/internal/callingx/callingx.js +55 -32
  21. package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -1
  22. package/dist/commonjs/utils/internal/registerSDKGlobals.js +2 -0
  23. package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
  24. package/dist/commonjs/utils/push/android.js +10 -93
  25. package/dist/commonjs/utils/push/android.js.map +1 -1
  26. package/dist/commonjs/utils/push/index.js +0 -11
  27. package/dist/commonjs/utils/push/index.js.map +1 -1
  28. package/dist/commonjs/utils/push/internal/utils.js +2 -31
  29. package/dist/commonjs/utils/push/internal/utils.js.map +1 -1
  30. package/dist/commonjs/utils/push/libs/callingx.js +9 -0
  31. package/dist/commonjs/utils/push/libs/callingx.js.map +1 -1
  32. package/dist/commonjs/utils/push/libs/index.js +0 -33
  33. package/dist/commonjs/utils/push/libs/index.js.map +1 -1
  34. package/dist/commonjs/utils/push/utils.js +0 -28
  35. package/dist/commonjs/utils/push/utils.js.map +1 -1
  36. package/dist/commonjs/version.js +1 -1
  37. package/dist/module/components/Call/RingingCallContent/IncomingCall.js +9 -2
  38. package/dist/module/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
  39. package/dist/module/components/Call/RingingCallContent/OutgoingCall.js +9 -2
  40. package/dist/module/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
  41. package/dist/module/components/Call/RingingCallContent/RingingCallContent.js +11 -12
  42. package/dist/module/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
  43. package/dist/module/components/Call/RingingCallContent/TextBasedIndicator.js +7 -2
  44. package/dist/module/components/Call/RingingCallContent/TextBasedIndicator.js.map +1 -1
  45. package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js +7 -3
  46. package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -1
  47. package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +1 -1
  48. package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
  49. package/dist/module/hooks/push/index.js +0 -4
  50. package/dist/module/hooks/push/index.js.map +1 -1
  51. package/dist/module/modules/call-manager/CallManager.js +6 -0
  52. package/dist/module/modules/call-manager/CallManager.js.map +1 -1
  53. package/dist/module/utils/StreamVideoRN/index.js +0 -17
  54. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  55. package/dist/module/utils/internal/callingx/callingx.js +56 -33
  56. package/dist/module/utils/internal/callingx/callingx.js.map +1 -1
  57. package/dist/module/utils/internal/registerSDKGlobals.js +2 -0
  58. package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
  59. package/dist/module/utils/push/android.js +11 -92
  60. package/dist/module/utils/push/android.js.map +1 -1
  61. package/dist/module/utils/push/index.js +0 -1
  62. package/dist/module/utils/push/index.js.map +1 -1
  63. package/dist/module/utils/push/internal/utils.js +0 -28
  64. package/dist/module/utils/push/internal/utils.js.map +1 -1
  65. package/dist/module/utils/push/libs/callingx.js +9 -0
  66. package/dist/module/utils/push/libs/callingx.js.map +1 -1
  67. package/dist/module/utils/push/libs/index.js +0 -3
  68. package/dist/module/utils/push/libs/index.js.map +1 -1
  69. package/dist/module/utils/push/utils.js +0 -25
  70. package/dist/module/utils/push/utils.js.map +1 -1
  71. package/dist/module/version.js +1 -1
  72. package/dist/typescript/components/Call/RingingCallContent/IncomingCall.d.ts.map +1 -1
  73. package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts.map +1 -1
  74. package/dist/typescript/components/Call/RingingCallContent/RingingCallContent.d.ts.map +1 -1
  75. package/dist/typescript/components/Call/RingingCallContent/TextBasedIndicator.d.ts.map +1 -1
  76. package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts.map +1 -1
  77. package/dist/typescript/hooks/push/index.d.ts.map +1 -1
  78. package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
  79. package/dist/typescript/utils/StreamVideoRN/index.d.ts +0 -7
  80. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  81. package/dist/typescript/utils/StreamVideoRN/types.d.ts +19 -40
  82. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  83. package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -1
  84. package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
  85. package/dist/typescript/utils/push/android.d.ts +1 -6
  86. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  87. package/dist/typescript/utils/push/index.d.ts +0 -1
  88. package/dist/typescript/utils/push/index.d.ts.map +1 -1
  89. package/dist/typescript/utils/push/internal/utils.d.ts +2 -10
  90. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -1
  91. package/dist/typescript/utils/push/libs/callingx.d.ts.map +1 -1
  92. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +16 -2
  93. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
  94. package/dist/typescript/utils/push/libs/index.d.ts +0 -3
  95. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
  96. package/dist/typescript/utils/push/utils.d.ts +0 -6
  97. package/dist/typescript/utils/push/utils.d.ts.map +1 -1
  98. package/dist/typescript/version.d.ts +1 -1
  99. package/expo-config-plugin/dist/withAppDelegate.js +56 -0
  100. package/ios/StreamVideoReactNative.h +14 -0
  101. package/ios/StreamVideoReactNative.m +129 -7
  102. package/package.json +4 -14
  103. package/src/components/Call/RingingCallContent/IncomingCall.tsx +14 -2
  104. package/src/components/Call/RingingCallContent/OutgoingCall.tsx +14 -2
  105. package/src/components/Call/RingingCallContent/RingingCallContent.tsx +7 -12
  106. package/src/components/Call/RingingCallContent/TextBasedIndicator.tsx +13 -2
  107. package/src/components/Livestream/ViewerLivestream/ViewerLivestream.tsx +10 -2
  108. package/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx +1 -1
  109. package/src/hooks/push/index.ts +0 -4
  110. package/src/modules/call-manager/CallManager.ts +6 -0
  111. package/src/utils/StreamVideoRN/index.ts +0 -22
  112. package/src/utils/StreamVideoRN/types.ts +19 -46
  113. package/src/utils/internal/callingx/callingx.ts +60 -29
  114. package/src/utils/internal/registerSDKGlobals.ts +2 -0
  115. package/src/utils/push/android.ts +11 -117
  116. package/src/utils/push/index.ts +0 -1
  117. package/src/utils/push/internal/utils.ts +1 -41
  118. package/src/utils/push/libs/callingx.ts +12 -0
  119. package/src/utils/push/libs/index.ts +0 -3
  120. package/src/utils/push/utils.ts +0 -37
  121. package/src/version.ts +1 -1
  122. package/dist/commonjs/hooks/push/useIosInitRemoteNotifications.js +0 -33
  123. package/dist/commonjs/hooks/push/useIosInitRemoteNotifications.js.map +0 -1
  124. package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js +0 -49
  125. package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js.map +0 -1
  126. package/dist/commonjs/utils/internal/newNotificationCallbacks.js +0 -17
  127. package/dist/commonjs/utils/internal/newNotificationCallbacks.js.map +0 -1
  128. package/dist/commonjs/utils/push/internal/rxSubjects.js +0 -13
  129. package/dist/commonjs/utils/push/internal/rxSubjects.js.map +0 -1
  130. package/dist/commonjs/utils/push/ios.js +0 -158
  131. package/dist/commonjs/utils/push/ios.js.map +0 -1
  132. package/dist/commonjs/utils/push/libs/expoNotifications.js +0 -25
  133. package/dist/commonjs/utils/push/libs/expoNotifications.js.map +0 -1
  134. package/dist/commonjs/utils/push/libs/iosPushNotification.js +0 -17
  135. package/dist/commonjs/utils/push/libs/iosPushNotification.js.map +0 -1
  136. package/dist/commonjs/utils/push/libs/notifee/index.js +0 -38
  137. package/dist/commonjs/utils/push/libs/notifee/index.js.map +0 -1
  138. package/dist/commonjs/utils/push/libs/notifee/lib.js +0 -16
  139. package/dist/commonjs/utils/push/libs/notifee/lib.js.map +0 -1
  140. package/dist/module/hooks/push/useIosInitRemoteNotifications.js +0 -27
  141. package/dist/module/hooks/push/useIosInitRemoteNotifications.js.map +0 -1
  142. package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js +0 -43
  143. package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js.map +0 -1
  144. package/dist/module/utils/internal/newNotificationCallbacks.js +0 -10
  145. package/dist/module/utils/internal/newNotificationCallbacks.js.map +0 -1
  146. package/dist/module/utils/push/internal/rxSubjects.js +0 -7
  147. package/dist/module/utils/push/internal/rxSubjects.js.map +0 -1
  148. package/dist/module/utils/push/ios.js +0 -148
  149. package/dist/module/utils/push/ios.js.map +0 -1
  150. package/dist/module/utils/push/libs/expoNotifications.js +0 -18
  151. package/dist/module/utils/push/libs/expoNotifications.js.map +0 -1
  152. package/dist/module/utils/push/libs/iosPushNotification.js +0 -11
  153. package/dist/module/utils/push/libs/iosPushNotification.js.map +0 -1
  154. package/dist/module/utils/push/libs/notifee/index.js +0 -31
  155. package/dist/module/utils/push/libs/notifee/index.js.map +0 -1
  156. package/dist/module/utils/push/libs/notifee/lib.js +0 -11
  157. package/dist/module/utils/push/libs/notifee/lib.js.map +0 -1
  158. package/dist/typescript/hooks/push/useIosInitRemoteNotifications.d.ts +0 -5
  159. package/dist/typescript/hooks/push/useIosInitRemoteNotifications.d.ts.map +0 -1
  160. package/dist/typescript/hooks/push/useProcessPushNonRingingCallEffect.d.ts +0 -7
  161. package/dist/typescript/hooks/push/useProcessPushNonRingingCallEffect.d.ts.map +0 -1
  162. package/dist/typescript/utils/internal/newNotificationCallbacks.d.ts +0 -10
  163. package/dist/typescript/utils/internal/newNotificationCallbacks.d.ts.map +0 -1
  164. package/dist/typescript/utils/push/internal/rxSubjects.d.ts +0 -11
  165. package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +0 -1
  166. package/dist/typescript/utils/push/ios.d.ts +0 -14
  167. package/dist/typescript/utils/push/ios.d.ts.map +0 -1
  168. package/dist/typescript/utils/push/libs/expoNotifications.d.ts +0 -6
  169. package/dist/typescript/utils/push/libs/expoNotifications.d.ts.map +0 -1
  170. package/dist/typescript/utils/push/libs/iosPushNotification.d.ts +0 -5
  171. package/dist/typescript/utils/push/libs/iosPushNotification.d.ts.map +0 -1
  172. package/dist/typescript/utils/push/libs/notifee/index.d.ts +0 -23
  173. package/dist/typescript/utils/push/libs/notifee/index.d.ts.map +0 -1
  174. package/dist/typescript/utils/push/libs/notifee/lib.d.ts +0 -4
  175. package/dist/typescript/utils/push/libs/notifee/lib.d.ts.map +0 -1
  176. package/src/hooks/push/useIosInitRemoteNotifications.ts +0 -29
  177. package/src/hooks/push/useProcessPushNonRingingCallEffect.ts +0 -50
  178. package/src/utils/internal/newNotificationCallbacks.ts +0 -29
  179. package/src/utils/push/internal/rxSubjects.ts +0 -10
  180. package/src/utils/push/ios.ts +0 -207
  181. package/src/utils/push/libs/expoNotifications.ts +0 -32
  182. package/src/utils/push/libs/iosPushNotification.ts +0 -22
  183. package/src/utils/push/libs/notifee/index.ts +0 -41
  184. package/src/utils/push/libs/notifee/lib.ts +0 -14
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useIosInitRemoteNotifications = void 0;
7
- var _videoReactBindings = require("@stream-io/video-react-bindings");
8
- var _react = require("react");
9
- var _utils = require("../../utils");
10
- var _ios = require("../../utils/push/ios");
11
- /**
12
- * This hook is used to initialize the push token for iOS.
13
- */
14
- const useIosInitRemoteNotifications = () => {
15
- const client = (0, _videoReactBindings.useStreamVideoClient)();
16
- const connectedUserId = (0, _videoReactBindings.useConnectedUser)()?.id;
17
- (0, _react.useEffect)(() => {
18
- const pushConfig = _utils.StreamVideoRN.getConfig().push;
19
- // NOTE: we need to wait for user to be connected before we can send the push token
20
- if (!client || !connectedUserId || !pushConfig) {
21
- return;
22
- }
23
- let unsubscribe = () => {};
24
- (0, _ios.initIosNonVoipToken)(client, pushConfig, unsubscribeListener => {
25
- unsubscribe = unsubscribeListener;
26
- });
27
- return () => {
28
- unsubscribe();
29
- };
30
- }, [client, connectedUserId]);
31
- };
32
- exports.useIosInitRemoteNotifications = useIosInitRemoteNotifications;
33
- //# sourceMappingURL=useIosInitRemoteNotifications.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_videoReactBindings","require","_react","_utils","_ios","useIosInitRemoteNotifications","client","useStreamVideoClient","connectedUserId","useConnectedUser","id","useEffect","pushConfig","StreamVideoRN","getConfig","push","unsubscribe","initIosNonVoipToken","unsubscribeListener","exports"],"sourceRoot":"../../../../src","sources":["hooks/push/useIosInitRemoteNotifications.ts"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAEA;AACA;AACA;AACO,MAAMI,6BAA6B,GAAGA,CAAA,KAAM;EACjD,MAAMC,MAAM,GAAG,IAAAC,wCAAoB,EAAC,CAAC;EACrC,MAAMC,eAAe,GAAG,IAAAC,oCAAgB,EAAC,CAAC,EAAEC,EAAE;EAC9C,IAAAC,gBAAS,EAAC,MAAM;IACd,MAAMC,UAAU,GAAGC,oBAAa,CAACC,SAAS,CAAC,CAAC,CAACC,IAAI;IACjD;IACA,IAAI,CAACT,MAAM,IAAI,CAACE,eAAe,IAAI,CAACI,UAAU,EAAE;MAC9C;IACF;IACA,IAAII,WAAW,GAAGA,CAAA,KAAM,CAAC,CAAC;IAC1B,IAAAC,wBAAmB,EAACX,MAAM,EAAEM,UAAU,EAAGM,mBAAmB,IAAK;MAC/DF,WAAW,GAAGE,mBAAmB;IACnC,CAAC,CAAC;IACF,OAAO,MAAM;MACXF,WAAW,CAAC,CAAC;IACf,CAAC;EACH,CAAC,EAAE,CAACV,MAAM,EAAEE,eAAe,CAAC,CAAC;AAC/B,CAAC;AAACW,OAAA,CAAAd,6BAAA,GAAAA,6BAAA","ignoreList":[]}
@@ -1,49 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useProcessPushNonRingingCallEffect = void 0;
7
- var _rxSubjects = require("../../utils/push/internal/rxSubjects");
8
- var _react = require("react");
9
- var _utils = require("../../utils");
10
- var _videoReactBindings = require("@stream-io/video-react-bindings");
11
- var _operators = require("rxjs/operators");
12
- var _utils2 = require("../../utils/push/internal/utils");
13
- var _videoClient = require("@stream-io/video-client");
14
- /**
15
- * This hook is used to process the non ringing call data via push notifications using the relevant rxjs subject
16
- * Note: this effect cannot work when push notifications are received when the app is in quit state or in other words when the client is not connected with a websocket.
17
- * So we essentially run this effect only when the client is connected with a websocket.
18
- */
19
- const useProcessPushNonRingingCallEffect = () => {
20
- const client = (0, _videoReactBindings.useStreamVideoClient)();
21
- const connectedUserId = (0, _videoReactBindings.useConnectedUser)()?.id;
22
- // The Effect to automatically add the non ringing call to our low level client state
23
- (0, _react.useEffect)(() => {
24
- const pushConfig = _utils.StreamVideoRN.getConfig().push;
25
- if (!pushConfig || !client || !connectedUserId) {
26
- return;
27
- }
28
- const subscription = _rxSubjects.pushNonRingingCallData$.pipe((0, _operators.filter)(NotUndefined)).subscribe(async ({
29
- cid,
30
- type
31
- }) => {
32
- _videoClient.videoLoggerSystem.getLogger('useProcessPushNonRingingCallEffect').debug(`processNonIncomingCallFromPush with callCId: ${cid} and type: ${type}`);
33
- await (0, _utils2.processNonIncomingCallFromPush)(client, cid, type);
34
- _rxSubjects.pushNonRingingCallData$.next(undefined); // remove the current data to avoid processing again
35
- });
36
- return () => {
37
- subscription.unsubscribe();
38
- };
39
- }, [client, connectedUserId]);
40
- };
41
-
42
- /**
43
- * A type guard to check if the data is not undefined
44
- */
45
- exports.useProcessPushNonRingingCallEffect = useProcessPushNonRingingCallEffect;
46
- function NotUndefined(data) {
47
- return data !== undefined;
48
- }
49
- //# sourceMappingURL=useProcessPushNonRingingCallEffect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_rxSubjects","require","_react","_utils","_videoReactBindings","_operators","_utils2","_videoClient","useProcessPushNonRingingCallEffect","client","useStreamVideoClient","connectedUserId","useConnectedUser","id","useEffect","pushConfig","StreamVideoRN","getConfig","push","subscription","pushNonRingingCallData$","pipe","filter","NotUndefined","subscribe","cid","type","videoLoggerSystem","getLogger","debug","processNonIncomingCallFromPush","next","undefined","unsubscribe","exports","data"],"sourceRoot":"../../../../src","sources":["hooks/push/useProcessPushNonRingingCallEffect.ts"],"mapp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YAAYA,CAAIY,IAAmB,EAAa;EACvD,OAAOA,IAAI,KAAKH,SAAS;AAC3B","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.onNewCallNotification = exports.default = void 0;
7
- let lastCid = '';
8
- const newNotificationCallbacks = {};
9
- const onNewCallNotification = (call, notificationType) => {
10
- if (newNotificationCallbacks.current && lastCid !== call.cid) {
11
- newNotificationCallbacks.current.forEach(callback => callback(call, notificationType));
12
- lastCid = call.cid;
13
- }
14
- };
15
- exports.onNewCallNotification = onNewCallNotification;
16
- var _default = exports.default = newNotificationCallbacks;
17
- //# sourceMappingURL=newNotificationCallbacks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["lastCid","newNotificationCallbacks","onNewCallNotification","call","notificationType","current","cid","forEach","callback","exports","_default","default"],"sourceRoot":"../../../../src","sources":["utils/internal/newNotificationCallbacks.ts"],"mappings":";;;;;;AAYA,IAAIA,OAAO,GAAG,EAAE;AAEhB,MAAMC,wBAAkD,GAAG,CAAC,CAAC;AAEtD,MAAMC,qBAAkD,GAAGA,CAChEC,IAAI,EACJC,gBAAgB,KACb;EACH,IAAIH,wBAAwB,CAACI,OAAO,IAAIL,OAAO,KAAKG,IAAI,CAACG,GAAG,EAAE;IAC5DL,wBAAwB,CAACI,OAAO,CAACE,OAAO,CAAEC,QAAQ,IAChDA,QAAQ,CAACL,IAAI,EAAEC,gBAAgB,CACjC,CAAC;IACDJ,OAAO,GAAGG,IAAI,CAACG,GAAG;EACpB;AACF,CAAC;AAACG,OAAA,CAAAP,qBAAA,GAAAA,qBAAA;AAAA,IAAAQ,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEaV,wBAAwB","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.pushNonRingingCallData$ = void 0;
7
- var _rxjs = require("rxjs");
8
- /**
9
- * This rxjs subject is used to store the call cid of the accepted incoming call from push notification
10
- * Note: it is should be subscribed only when a user has connected to the websocket of Stream
11
- */
12
- const pushNonRingingCallData$ = exports.pushNonRingingCallData$ = new _rxjs.BehaviorSubject(undefined);
13
- //# sourceMappingURL=rxSubjects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_rxjs","require","pushNonRingingCallData$","exports","BehaviorSubject","undefined"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/rxSubjects.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACO,MAAMC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,IAAIE,qBAAe,CAExDC,SAAS,CAAC","ignoreList":[]}
@@ -1,158 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.initIosNonVoipToken = initIosNonVoipToken;
7
- exports.onPushNotificationiOSStreamVideoEvent = onPushNotificationiOSStreamVideoEvent;
8
- exports.oniOSNotifeeEvent = exports.oniOSExpoNotificationEvent = void 0;
9
- var _reactNative = require("react-native");
10
- var _rxSubjects = require("./internal/rxSubjects");
11
- var _libs = require("./libs");
12
- var _videoClient = require("@stream-io/video-client");
13
- var _pushLogoutCallback = require("../internal/pushLogoutCallback");
14
- var _StreamVideoRN = require("../StreamVideoRN");
15
- let lastApnToken = {
16
- token: '',
17
- userId: ''
18
- };
19
- function processNonRingingNotificationStreamPayload(streamPayload) {
20
- if (streamPayload?.sender === 'stream.video' && streamPayload?.type !== 'call.ring') {
21
- const cid = streamPayload.call_cid;
22
- const type = streamPayload.type;
23
- const logger = _videoClient.videoLoggerSystem.getLogger('processNonRingingNotificationStreamPayload');
24
- logger.trace(`cid, type - ${cid}, ${type}`);
25
- _rxSubjects.pushNonRingingCallData$.next({
26
- cid,
27
- type
28
- });
29
- return {
30
- cid,
31
- type
32
- };
33
- }
34
- return undefined;
35
- }
36
- const oniOSExpoNotificationEvent = event => {
37
- const pushConfig = _StreamVideoRN.StreamVideoRN.getConfig().push;
38
- if (pushConfig) {
39
- const trigger = event.request.trigger;
40
- if (trigger && typeof trigger === 'object' && 'type' in trigger && trigger.type === 'push' && trigger.payload?.stream) {
41
- const streamPayload = trigger.payload.stream;
42
- const logger = _videoClient.videoLoggerSystem.getLogger('processNonRingingNotificationStreamPayload');
43
- logger.trace(`processNonRingingNotificationStreamPayload - ${JSON.stringify(streamPayload)}`);
44
- processNonRingingNotificationStreamPayload(streamPayload);
45
- }
46
- }
47
- };
48
- exports.oniOSExpoNotificationEvent = oniOSExpoNotificationEvent;
49
- const oniOSNotifeeEvent = ({
50
- event
51
- }) => {
52
- if (_reactNative.Platform.OS !== 'ios') return;
53
- const pushConfig = _StreamVideoRN.StreamVideoRN.getConfig().push;
54
- const {
55
- type,
56
- detail
57
- } = event;
58
- const notifeeLib = (0, _libs.getNotifeeLibThrowIfNotInstalledForPush)();
59
- if (pushConfig && type === notifeeLib.EventType.PRESS) {
60
- const streamPayload = detail.notification?.data?.stream;
61
- const result = processNonRingingNotificationStreamPayload(streamPayload);
62
- if (result) {
63
- const logger = _videoClient.videoLoggerSystem.getLogger('oniOSNotifeeEvent');
64
- logger.debug(`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})`);
65
- pushConfig.onTapNonRingingCallNotification?.(result.cid, result.type);
66
- }
67
- }
68
- };
69
- exports.oniOSNotifeeEvent = oniOSNotifeeEvent;
70
- function onPushNotificationiOSStreamVideoEvent(notification) {
71
- const pushNotificationIosLib = (0, _libs.getPushNotificationIosLib)();
72
- const data = notification.getData();
73
- const streamPayload = data?.stream;
74
- const logger = _videoClient.videoLoggerSystem.getLogger('onPushNotificationiOSStreamVideoEvent');
75
- if (!streamPayload) {
76
- logger.trace(`skipping process: no stream payload found in notification data - ${JSON.stringify(data)}`);
77
- return;
78
- }
79
- const isClicked = data.userInteraction === 1;
80
- const pushConfig = _StreamVideoRN.StreamVideoRN.getConfig().push;
81
- if (!isClicked || !pushConfig) {
82
- logger.debug(`notification.finish called and returning - isClicked: ${isClicked}, pushConfig: ${!!pushConfig}`);
83
- notification.finish(pushNotificationIosLib.FetchResult.NoData);
84
- return;
85
- }
86
- // listen to foreground notifications
87
- const result = processNonRingingNotificationStreamPayload(streamPayload);
88
- if (result) {
89
- logger.debug(`onTapNonRingingCallNotification?.(${result.cid}, ${result.type})`);
90
- pushConfig.onTapNonRingingCallNotification?.(result.cid, result.type);
91
- }
92
- notification.finish(pushNotificationIosLib.FetchResult.NoData);
93
- }
94
-
95
- /** Send token to stream */
96
- async function initIosNonVoipToken(client, pushConfig, setUnsubscribeListener) {
97
- if (_reactNative.Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName || !pushConfig.onTapNonRingingCallNotification) {
98
- return;
99
- }
100
- const logger = _videoClient.videoLoggerSystem.getLogger('initIosNonVoipToken');
101
- const setDeviceToken = async token => {
102
- const userId = client.streamClient._user?.id ?? '';
103
- if (lastApnToken.token === token && lastApnToken.userId === userId) {
104
- logger.debug('Skipped sending device token to stream as it was already sent', token);
105
- return;
106
- }
107
- (0, _pushLogoutCallback.setPushLogoutCallback)(async () => {
108
- lastApnToken = {
109
- token: '',
110
- userId: ''
111
- };
112
- try {
113
- logger.debug('Remove device token - setPushLogoutCallback', token);
114
- await client.removeDevice(token);
115
- } catch (err) {
116
- logger.warn('setPushLogoutCallback - Failed to remove apn token from stream', err);
117
- }
118
- });
119
- const push_provider_name = pushConfig.ios?.pushProviderName;
120
- logger.debug('Add device token to stream', token);
121
- await client.addDevice(token, 'apn', push_provider_name).then(() => {
122
- lastApnToken = {
123
- token,
124
- userId
125
- };
126
- }).catch(err => {
127
- logger.warn('Failed to add apn token to stream', err);
128
- });
129
- };
130
- if (pushConfig.isExpo) {
131
- const expoNotificationsLib = (0, _libs.getExpoNotificationsLib)();
132
- if (expoNotificationsLib) {
133
- expoNotificationsLib.getDevicePushTokenAsync().then(devicePushToken => {
134
- logger.debug('Got device token - expoNotificationsLib.getDevicePushTokenAsync', devicePushToken.data);
135
- setDeviceToken(devicePushToken.data);
136
- });
137
- const subscription = expoNotificationsLib.addPushTokenListener(devicePushToken => {
138
- logger.debug('Got device token - expoNotificationsLib.addPushTokenListener', devicePushToken.data);
139
- setDeviceToken(devicePushToken.data);
140
- });
141
- setUnsubscribeListener(() => {
142
- logger.debug(`removed expo addPushTokenListener`);
143
- subscription.remove();
144
- });
145
- }
146
- } else {
147
- const pushNotificationIosLib = (0, _libs.getPushNotificationIosLib)();
148
- pushNotificationIosLib.addEventListener('register', token => {
149
- logger.debug(`Got device token - pushNotificationIosLib.addEventListener('register')`, token);
150
- setDeviceToken(token);
151
- });
152
- setUnsubscribeListener(() => {
153
- logger.debug(`pushNotificationIosLib.removeEventListener('register')`);
154
- pushNotificationIosLib.removeEventListener('register');
155
- });
156
- }
157
- }
158
- //# sourceMappingURL=ios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_rxSubjects","_libs","_videoClient","_pushLogoutCallback","_StreamVideoRN","lastApnToken","token","userId","processNonRingingNotificationStreamPayload","streamPayload","sender","type","cid","call_cid","logger","videoLoggerSystem","getLogger","trace","pushNonRingingCallData$","next","undefined","oniOSExpoNotificationEvent","event","pushConfig","StreamVideoRN","getConfig","push","trigger","request","payload","stream","JSON","stringify","exports","oniOSNotifeeEvent","Platform","OS","detail","notifeeLib","getNotifeeLibThrowIfNotInstalledForPush","EventType","PRESS","notification","data","result","debug","onTapNonRingingCallNotification","onPushNotificationiOSStreamVideoEvent","pushNotificationIosLib","getPushNotificationIosLib","getData","isClicked","userInteraction","finish","FetchResult","NoData","initIosNonVoipToken","client","setUnsubscribeListener","ios","pushProviderName","setDeviceToken","streamClient","_user","id","setPushLogoutCallback","removeDevice","err","warn","push_provider_name","addDevice","then","catch","isExpo","expoNotificationsLib","getExpoNotificationsLib","getDevicePushTokenAsync","devicePushToken","subscription","addPushTokenListener","remove","addEventListener","removeEventListener"],"sourceRoot":"../../../../src","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oB,CAACE,uBAAuB,CAAC,CAAC,CAACL,IAAI,CAAEM,eAAe,IAAK;QACvE/D,MAAM,CAAC+B,KAAK,CACV,iEAAiE,EACjEgC,eAAe,CAAClC,IAClB,CAAC;QACDkB,cAAc,CAACgB,eAAe,CAAClC,IAAI,CAAC;MACtC,CAAC,CAAC;MACF,MAAMmC,YAAY,GAAGJ,oBAAoB,CAACK,oBAAoB,CAC3DF,eAAe,IAAK;QACnB/D,MAAM,CAAC+B,KAAK,CACV,8DAA8D,EAC9DgC,eAAe,CAAClC,IAClB,CAAC;QACDkB,cAAc,CAACgB,eAAe,CAAClC,IAAI,CAAC;MACtC,CACF,CAAC;MACDe,sBAAsB,CAAC,MAAM;QAC3B5C,MAAM,CAAC+B,KAAK,CAAC,mCAAmC,CAAC;QACjDiC,YAAY,CAACE,MAAM,CAAC,CAAC;MACvB,CAAC,CAAC;IACJ;EACF,CAAC,MAAM;IACL,MAAMhC,sBAAsB,GAAG,IAAAC,+BAAyB,EAAC,CAAC;IAC1DD,sBAAsB,CAACiC,gBAAgB,CAAC,UAAU,EAAG3E,KAAK,IAAK;MAC7DQ,MAAM,CAAC+B,KAAK,CACV,wEAAwE,EACxEvC,KACF,CAAC;MACDuD,cAAc,CAACvD,KAAK,CAAC;IACvB,CAAC,CAAC;IACFoD,sBAAsB,CAAC,MAAM;MAC3B5C,MAAM,CAAC+B,KAAK,CAAC,wDAAwD,CAAC;MACtEG,sBAAsB,CAACkC,mBAAmB,CAAC,UAAU,CAAC;IACxD,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getExpoNotificationsLib = getExpoNotificationsLib;
7
- exports.getExpoNotificationsLibNoThrow = getExpoNotificationsLibNoThrow;
8
- var _videoClient = require("@stream-io/video-client");
9
- let expoNotificationsLib;
10
- try {
11
- expoNotificationsLib = require('expo-notifications');
12
- } catch {}
13
- function getExpoNotificationsLib() {
14
- if (!expoNotificationsLib) {
15
- throw Error('expo-notifications library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/notifications/ for installation instructions. It is required for non ringing push notifications.');
16
- }
17
- return expoNotificationsLib;
18
- }
19
- function getExpoNotificationsLibNoThrow() {
20
- if (!expoNotificationsLib) {
21
- _videoClient.videoLoggerSystem.getLogger('getExpoNotificationsLibNoThrow').debug('expo-notifications library is not installed. It is required for non ringing push notifications and not for ringing');
22
- }
23
- return expoNotificationsLib;
24
- }
25
- //# sourceMappingURL=expoNotifications.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_videoClient","require","expoNotificationsLib","getExpoNotificationsLib","Error","getExpoNotificationsLibNoThrow","videoLoggerSystem","getLogger","debug"],"sourceRoot":"../../../../../src","sources":["utils/push/libs/expoNotifications.ts"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAIC,oBAAsD;AAE1D,IAAI;EACFA,oBAAoB,GAAGD,OAAO,CAAC,oBAAoB,CAAC;AACtD,CAAC,CAAC,MAAM,CAAC;AAEF,SAASE,uBAAuBA,CAAA,EAAG;EACxC,IAAI,CAACD,oBAAoB,EAAE;IACzB,MAAME,KAAK,CACT,oMACF,CAAC;EACH;EACA,OAAOF,oBAAoB;AAC7B;AAEO,SAASG,8BAA8BA,CAAA,EAAG;EAC/C,IAAI,CAACH,oBAAoB,EAAE;IACzBI,8BAAiB,CACdC,SAAS,CAAC,gCAAgC,CAAC,CAC3CC,KAAK,CACJ,oHACF,CAAC;EACL;EACA,OAAON,oBAAoB;AAC7B","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getPushNotificationIosLib = getPushNotificationIosLib;
7
- let pushNotificationIosLib;
8
- try {
9
- pushNotificationIosLib = require('@react-native-community/push-notification-ios').default;
10
- } catch {}
11
- function getPushNotificationIosLib() {
12
- if (!pushNotificationIosLib) {
13
- throw Error('@react-native-community/push-notification-ios library is not installed. Please install it using "yarn add @react-native-community/push-notification-ios" or "npm i @react-native-community/push-notification-ios --save"');
14
- }
15
- return pushNotificationIosLib;
16
- }
17
- //# sourceMappingURL=iosPushNotification.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["pushNotificationIosLib","require","default","getPushNotificationIosLib","Error"],"sourceRoot":"../../../../../src","sources":["utils/push/libs/iosPushNotification.ts"],"mappings":";;;;;;AAKA,IAAIA,sBAA0D;AAI9D,IAAI;EACFA,sBAAsB,GACpBC,OAAO,CAAC,+CAA+C,CAAC,CAACC,OAAO;AACpE,CAAC,CAAC,MAAM,CAAC;AAEF,SAASC,yBAAyBA,CAAA,EAAG;EAC1C,IAAI,CAACH,sBAAsB,EAAE;IAC3B,MAAMI,KAAK,CACT,0NACF,CAAC;EACH;EACA,OAAOJ,sBAAsB;AAC/B","ignoreList":[]}
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getIncomingCallForegroundServiceTypes = getIncomingCallForegroundServiceTypes;
7
- exports.getNotifeeLibThrowIfNotInstalledForPush = getNotifeeLibThrowIfNotInstalledForPush;
8
- var _lib = require("./lib");
9
- var AndroidForegroundServiceType = /*#__PURE__*/function (AndroidForegroundServiceType) {
10
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_CAMERA"] = 64] = "FOREGROUND_SERVICE_TYPE_CAMERA";
11
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE"] = 16] = "FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE";
12
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_DATA_SYNC"] = 1] = "FOREGROUND_SERVICE_TYPE_DATA_SYNC";
13
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_HEALTH"] = 256] = "FOREGROUND_SERVICE_TYPE_HEALTH";
14
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_LOCATION"] = 8] = "FOREGROUND_SERVICE_TYPE_LOCATION";
15
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK"] = 2] = "FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK";
16
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION"] = 32] = "FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION";
17
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING"] = 8192] = "FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING";
18
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MICROPHONE"] = 128] = "FOREGROUND_SERVICE_TYPE_MICROPHONE";
19
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_PHONE_CALL"] = 4] = "FOREGROUND_SERVICE_TYPE_PHONE_CALL";
20
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING"] = 512] = "FOREGROUND_SERVICE_TYPE_REMOTE_MESSAGING";
21
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_SHORT_SERVICE"] = 2048] = "FOREGROUND_SERVICE_TYPE_SHORT_SERVICE";
22
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_SPECIAL_USE"] = 1073741824] = "FOREGROUND_SERVICE_TYPE_SPECIAL_USE";
23
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED"] = 1024] = "FOREGROUND_SERVICE_TYPE_SYSTEM_EXEMPTED";
24
- AndroidForegroundServiceType[AndroidForegroundServiceType["FOREGROUND_SERVICE_TYPE_MANIFEST"] = -1] = "FOREGROUND_SERVICE_TYPE_MANIFEST";
25
- return AndroidForegroundServiceType;
26
- }(AndroidForegroundServiceType || {});
27
- const INSTALLATION_INSTRUCTION = 'Please see https://notifee.app/react-native/docs/installation for installation instructions';
28
- function getNotifeeLibThrowIfNotInstalledForPush() {
29
- if (!_lib.lib) {
30
- throw Error('@notifee/react-native is not installed. It is required for implementing push notifications. ' + INSTALLATION_INSTRUCTION);
31
- }
32
- return _lib.lib;
33
- }
34
- function getIncomingCallForegroundServiceTypes() {
35
- const types = [AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE];
36
- return types;
37
- }
38
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_lib","require","AndroidForegroundServiceType","INSTALLATION_INSTRUCTION","getNotifeeLibThrowIfNotInstalledForPush","lib","Error","getIncomingCallForegroundServiceTypes","types","FOREGROUND_SERVICE_TYPE_SHORT_SERVICE"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/notifee/index.ts"],"mappings":";;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAAuC,IAIlCC,4BAA4B,0BAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAA5BA,4BAA4B,CAA5BA,4BAA4B;EAAA,OAA5BA,4BAA4B;AAAA,EAA5BA,4BAA4B;AAkBjC,MAAMC,wBAAwB,GAC5B,6FAA6F;AAExF,SAASC,uCAAuCA,CAAA,EAAG;EACxD,IAAI,CAACC,QAAG,EAAE;IACR,MAAMC,KAAK,CACT,8FAA8F,GAC5FH,wBACJ,CAAC;EACH;EACA,OAAOE,QAAG;AACZ;AAEO,SAASE,qCAAqCA,CAAA,EAAG;EACtD,MAAMC,KAAqC,GAAG,CAC5CN,4BAA4B,CAACO,qCAAqC,CACnE;EACD,OAAOD,KAAK;AACd","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.lib = void 0;
7
- let lib = exports.lib = void 0;
8
- try {
9
- exports.lib = lib = require('@notifee/react-native');
10
- } catch {}
11
-
12
- /*
13
- IMPORTANT: must keep a failing import in a different file
14
- Else on commonjs, metro doesnt resolve any other modules properly in a file, if one of the module is not installed
15
- */
16
- //# sourceMappingURL=lib.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["lib","exports","require"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/notifee/lib.ts"],"mappings":";;;;;;AAEA,IAAIA,GAAqB,GAAAC,OAAA,CAAAD,GAAA;AAEzB,IAAI;EACFC,OAAA,CAAAD,GAAA,GAAAA,GAAG,GAAGE,OAAO,CAAC,uBAAuB,CAAC;AACxC,CAAC,CAAC,MAAM,CAAC;;AAIT;AACA;AACA;AACA","ignoreList":[]}
@@ -1,27 +0,0 @@
1
- import { useConnectedUser, useStreamVideoClient } from '@stream-io/video-react-bindings';
2
- import { useEffect } from 'react';
3
- import { StreamVideoRN } from '../../utils';
4
- import { initIosNonVoipToken } from '../../utils/push/ios';
5
-
6
- /**
7
- * This hook is used to initialize the push token for iOS.
8
- */
9
- export const useIosInitRemoteNotifications = () => {
10
- const client = useStreamVideoClient();
11
- const connectedUserId = useConnectedUser()?.id;
12
- useEffect(() => {
13
- const pushConfig = StreamVideoRN.getConfig().push;
14
- // NOTE: we need to wait for user to be connected before we can send the push token
15
- if (!client || !connectedUserId || !pushConfig) {
16
- return;
17
- }
18
- let unsubscribe = () => {};
19
- initIosNonVoipToken(client, pushConfig, unsubscribeListener => {
20
- unsubscribe = unsubscribeListener;
21
- });
22
- return () => {
23
- unsubscribe();
24
- };
25
- }, [client, connectedUserId]);
26
- };
27
- //# sourceMappingURL=useIosInitRemoteNotifications.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useConnectedUser","useStreamVideoClient","useEffect","StreamVideoRN","initIosNonVoipToken","useIosInitRemoteNotifications","client","connectedUserId","id","pushConfig","getConfig","push","unsubscribe","unsubscribeListener"],"sourceRoot":"../../../../src","sources":["hooks/push/useIosInitRemoteNotifications.ts"],"mappings":"AAAA,SACEA,gBAAgB,EAChBC,oBAAoB,QACf,iCAAiC;AACxC,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,aAAa,QAAQ,aAAa;AAC3C,SAASC,mBAAmB,QAAQ,sBAAsB;;AAE1D;AACA;AACA;AACA,OAAO,MAAMC,6BAA6B,GAAGA,CAAA,KAAM;EACjD,MAAMC,MAAM,GAAGL,oBAAoB,CAAC,CAAC;EACrC,MAAMM,eAAe,GAAGP,gBAAgB,CAAC,CAAC,EAAEQ,EAAE;EAC9CN,SAAS,CAAC,MAAM;IACd,MAAMO,UAAU,GAAGN,aAAa,CAACO,SAAS,CAAC,CAAC,CAACC,IAAI;IACjD;IACA,IAAI,CAACL,MAAM,IAAI,CAACC,eAAe,IAAI,CAACE,UAAU,EAAE;MAC9C;IACF;IACA,IAAIG,WAAW,GAAGA,CAAA,KAAM,CAAC,CAAC;IAC1BR,mBAAmB,CAACE,MAAM,EAAEG,UAAU,EAAGI,mBAAmB,IAAK;MAC/DD,WAAW,GAAGC,mBAAmB;IACnC,CAAC,CAAC;IACF,OAAO,MAAM;MACXD,WAAW,CAAC,CAAC;IACf,CAAC;EACH,CAAC,EAAE,CAACN,MAAM,EAAEC,eAAe,CAAC,CAAC;AAC/B,CAAC","ignoreList":[]}
@@ -1,43 +0,0 @@
1
- import { pushNonRingingCallData$ } from '../../utils/push/internal/rxSubjects';
2
- import { useEffect } from 'react';
3
- import { StreamVideoRN } from '../../utils';
4
- import { useConnectedUser, useStreamVideoClient } from '@stream-io/video-react-bindings';
5
- import { filter } from 'rxjs/operators';
6
- import { processNonIncomingCallFromPush } from '../../utils/push/internal/utils';
7
- import { videoLoggerSystem } from '@stream-io/video-client';
8
-
9
- /**
10
- * This hook is used to process the non ringing call data via push notifications using the relevant rxjs subject
11
- * Note: this effect cannot work when push notifications are received when the app is in quit state or in other words when the client is not connected with a websocket.
12
- * So we essentially run this effect only when the client is connected with a websocket.
13
- */
14
- export const useProcessPushNonRingingCallEffect = () => {
15
- const client = useStreamVideoClient();
16
- const connectedUserId = useConnectedUser()?.id;
17
- // The Effect to automatically add the non ringing call to our low level client state
18
- useEffect(() => {
19
- const pushConfig = StreamVideoRN.getConfig().push;
20
- if (!pushConfig || !client || !connectedUserId) {
21
- return;
22
- }
23
- const subscription = pushNonRingingCallData$.pipe(filter(NotUndefined)).subscribe(async ({
24
- cid,
25
- type
26
- }) => {
27
- videoLoggerSystem.getLogger('useProcessPushNonRingingCallEffect').debug(`processNonIncomingCallFromPush with callCId: ${cid} and type: ${type}`);
28
- await processNonIncomingCallFromPush(client, cid, type);
29
- pushNonRingingCallData$.next(undefined); // remove the current data to avoid processing again
30
- });
31
- return () => {
32
- subscription.unsubscribe();
33
- };
34
- }, [client, connectedUserId]);
35
- };
36
-
37
- /**
38
- * A type guard to check if the data is not undefined
39
- */
40
- function NotUndefined(data) {
41
- return data !== undefined;
42
- }
43
- //# sourceMappingURL=useProcessPushNonRingingCallEffect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["pushNonRingingCallData$","useEffect","StreamVideoRN","useConnectedUser","useStreamVideoClient","filter","processNonIncomingCallFromPush","videoLoggerSystem","useProcessPushNonRingingCallEffect","client","connectedUserId","id","pushConfig","getConfig","push","subscription","pipe","NotUndefined","subscribe","cid","type","getLogger","debug","next","undefined","unsubscribe","data"],"sourceRoot":"../../../../src","sources":["hooks/push/useProcessPushNonRingingCallEffect.ts"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,sCAAsC;AAC9E,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,aAAa,QAAQ,aAAa;AAC3C,SACEC,gBAAgB,EAChBC,oBAAoB,QACf,iCAAiC;AACxC,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,8BAA8B,QAAQ,iCAAiC;AAChF,SAASC,iBAAiB,QAAQ,yBAAyB;;AAE3D;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kCAAkC,GAAGA,CAAA,KAAM;EACtD,MAAMC,MAAM,GAAGL,oBAAoB,CAAC,CAAC;EACrC,MAAMM,eAAe,GAAGP,gBAAgB,CAAC,CAAC,EAAEQ,EAAE;EAC9C;EACAV,SAAS,CAAC,MAAM;IACd,MAAMW,UAAU,GAAGV,aAAa,CAACW,SAAS,CAAC,CAAC,CAACC,IAAI;IACjD,IAAI,CAACF,UAAU,IAAI,CAACH,MAAM,IAAI,CAACC,eAAe,EAAE;MAC9C;IACF;IAEA,MAAMK,YAAY,GAAGf,uBAAuB,CACzCgB,IAAI,CAACX,MAAM,CAACY,YAAY,CAAC,CAAC,CAC1BC,SAAS,CAAC,OAAO;MAAEC,GAAG;MAAEC;IAAK,CAAC,KAAK;MAClCb,iBAAiB,CACdc,SAAS,CAAC,oCAAoC,CAAC,CAC/CC,KAAK,CACJ,gDAAgDH,GAAG,cAAcC,IAAI,EACvE,CAAC;MACH,MAAMd,8BAA8B,CAACG,MAAM,EAAEU,GAAG,EAAEC,IAAI,CAAC;MACvDpB,uBAAuB,CAACuB,IAAI,CAACC,SAAS,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEJ,OAAO,MAAM;MACXT,YAAY,CAACU,WAAW,CAAC,CAAC;IAC5B,CAAC;EACH,CAAC,EAAE,CAAChB,MAAM,EAAEC,eAAe,CAAC,CAAC;AAC/B,CAAC;;AAED;AACA;AACA;AACA,SAASO,YAAYA,CAAIS,IAAmB,EAAa;EACvD,OAAOA,IAAI,KAAKF,SAAS;AAC3B","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- let lastCid = '';
2
- const newNotificationCallbacks = {};
3
- export const onNewCallNotification = (call, notificationType) => {
4
- if (newNotificationCallbacks.current && lastCid !== call.cid) {
5
- newNotificationCallbacks.current.forEach(callback => callback(call, notificationType));
6
- lastCid = call.cid;
7
- }
8
- };
9
- export default newNotificationCallbacks;
10
- //# sourceMappingURL=newNotificationCallbacks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["lastCid","newNotificationCallbacks","onNewCallNotification","call","notificationType","current","cid","forEach","callback"],"sourceRoot":"../../../../src","sources":["utils/internal/newNotificationCallbacks.ts"],"mappings":"AAYA,IAAIA,OAAO,GAAG,EAAE;AAEhB,MAAMC,wBAAkD,GAAG,CAAC,CAAC;AAE7D,OAAO,MAAMC,qBAAkD,GAAGA,CAChEC,IAAI,EACJC,gBAAgB,KACb;EACH,IAAIH,wBAAwB,CAACI,OAAO,IAAIL,OAAO,KAAKG,IAAI,CAACG,GAAG,EAAE;IAC5DL,wBAAwB,CAACI,OAAO,CAACE,OAAO,CAAEC,QAAQ,IAChDA,QAAQ,CAACL,IAAI,EAAEC,gBAAgB,CACjC,CAAC;IACDJ,OAAO,GAAGG,IAAI,CAACG,GAAG;EACpB;AACF,CAAC;AAED,eAAeL,wBAAwB","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- import { BehaviorSubject } from 'rxjs';
2
- /**
3
- * This rxjs subject is used to store the call cid of the accepted incoming call from push notification
4
- * Note: it is should be subscribed only when a user has connected to the websocket of Stream
5
- */
6
- export const pushNonRingingCallData$ = new BehaviorSubject(undefined);
7
- //# sourceMappingURL=rxSubjects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["BehaviorSubject","pushNonRingingCallData$","undefined"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/rxSubjects.ts"],"mappings":"AAAA,SAASA,eAAe,QAAQ,MAAM;AAGtC;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAG,IAAID,eAAe,CAExDE,SAAS,CAAC","ignoreList":[]}