@stream-io/video-react-native-sdk 1.44.0 → 1.45.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 (81) hide show
  1. package/CHANGELOG.md +25 -3
  2. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +9 -5
  3. package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -1
  4. package/dist/commonjs/hooks/useLoopbackRecording.js +10 -127
  5. package/dist/commonjs/hooks/useLoopbackRecording.js.map +1 -1
  6. package/dist/commonjs/utils/StreamVideoRN/index.js +2 -0
  7. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  8. package/dist/commonjs/utils/internal/callingx/callingx.js +2 -2
  9. package/dist/commonjs/utils/push/android.js +7 -167
  10. package/dist/commonjs/utils/push/android.js.map +1 -1
  11. package/dist/commonjs/utils/push/internal/android.js +186 -0
  12. package/dist/commonjs/utils/push/internal/android.js.map +1 -0
  13. package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js +9 -1
  14. package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js.map +1 -1
  15. package/dist/commonjs/utils/push/libs/firebaseMessaging/lib.js +1 -1
  16. package/dist/commonjs/utils/push/libs/firebaseMessaging/lib.js.map +1 -1
  17. package/dist/commonjs/utils/push/setupAndroidPushEvents.js +25 -0
  18. package/dist/commonjs/utils/push/setupAndroidPushEvents.js.map +1 -0
  19. package/dist/commonjs/utils/push/setupCallingExpEvents.js +6 -2
  20. package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +1 -1
  21. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
  22. package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
  23. package/dist/commonjs/utils/push/utils.js.map +1 -1
  24. package/dist/commonjs/version.js +1 -1
  25. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +9 -5
  26. package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -1
  27. package/dist/module/hooks/useLoopbackRecording.js +10 -127
  28. package/dist/module/hooks/useLoopbackRecording.js.map +1 -1
  29. package/dist/module/utils/StreamVideoRN/index.js +2 -0
  30. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  31. package/dist/module/utils/internal/callingx/callingx.js +2 -2
  32. package/dist/module/utils/push/android.js +9 -169
  33. package/dist/module/utils/push/android.js.map +1 -1
  34. package/dist/module/utils/push/internal/android.js +182 -0
  35. package/dist/module/utils/push/internal/android.js.map +1 -0
  36. package/dist/module/utils/push/libs/firebaseMessaging/index.js +9 -1
  37. package/dist/module/utils/push/libs/firebaseMessaging/index.js.map +1 -1
  38. package/dist/module/utils/push/libs/firebaseMessaging/lib.js +1 -1
  39. package/dist/module/utils/push/libs/firebaseMessaging/lib.js.map +1 -1
  40. package/dist/module/utils/push/setupAndroidPushEvents.js +21 -0
  41. package/dist/module/utils/push/setupAndroidPushEvents.js.map +1 -0
  42. package/dist/module/utils/push/setupCallingExpEvents.js +6 -2
  43. package/dist/module/utils/push/setupCallingExpEvents.js.map +1 -1
  44. package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
  45. package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
  46. package/dist/module/utils/push/utils.js.map +1 -1
  47. package/dist/module/version.js +1 -1
  48. package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +1 -1
  49. package/dist/typescript/hooks/useLoopbackRecording.d.ts +12 -69
  50. package/dist/typescript/hooks/useLoopbackRecording.d.ts.map +1 -1
  51. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  52. package/dist/typescript/utils/push/android.d.ts +3 -4
  53. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  54. package/dist/typescript/utils/push/internal/android.d.ts +8 -0
  55. package/dist/typescript/utils/push/internal/android.d.ts.map +1 -0
  56. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +6 -4
  57. package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
  58. package/dist/typescript/utils/push/libs/firebaseMessaging/lib.d.ts +2 -2
  59. package/dist/typescript/utils/push/libs/firebaseMessaging/lib.d.ts.map +1 -1
  60. package/dist/typescript/utils/push/setupAndroidPushEvents.d.ts +3 -0
  61. package/dist/typescript/utils/push/setupAndroidPushEvents.d.ts.map +1 -0
  62. package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +1 -1
  63. package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
  64. package/dist/typescript/utils/push/utils.d.ts +2 -2
  65. package/dist/typescript/utils/push/utils.d.ts.map +1 -1
  66. package/dist/typescript/version.d.ts +1 -1
  67. package/ios/TracksRecorder/RecorderVideoSink.swift +92 -5
  68. package/package.json +4 -4
  69. package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +12 -5
  70. package/src/hooks/useLoopbackRecording.ts +36 -248
  71. package/src/utils/StreamVideoRN/index.ts +2 -0
  72. package/src/utils/internal/callingx/callingx.ts +2 -2
  73. package/src/utils/push/android.ts +12 -237
  74. package/src/utils/push/internal/android.ts +252 -0
  75. package/src/utils/push/libs/firebaseMessaging/index.ts +16 -5
  76. package/src/utils/push/libs/firebaseMessaging/lib.ts +3 -3
  77. package/src/utils/push/setupAndroidPushEvents.ts +25 -0
  78. package/src/utils/push/setupCallingExpEvents.ts +6 -3
  79. package/src/utils/push/setupIosVoipPushEvents.ts +8 -7
  80. package/src/utils/push/utils.ts +2 -4
  81. package/src/version.ts +1 -1
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+
3
+ import { CallingState } from '@stream-io/video-client';
4
+ import { AppState, Platform } from 'react-native';
5
+ import { getCallingxLib, getCallingxLibIfAvailable } from '../libs';
6
+ import { StreamVideoRN } from '../../StreamVideoRN';
7
+ import { pushUnsubscriptionCallbacks } from './constants';
8
+ import { canListenToWS, shouldCallBeClosed } from './utils';
9
+
10
+ /**
11
+ * Handles a Stream Video `call.ring` push payload: connects the WS to watch the ringing call
12
+ * and auto-dismisses it if it has already ended/been handled elsewhere. Non-ringing types are
13
+ * ignored (their display is app responsibility). Android-only; a no-op on other platforms.
14
+ */
15
+ export const onRingNotificationReceived = async data => {
16
+ /* Example data from firebase
17
+ "message": {
18
+ "data": {
19
+ call_cid: 'audio_room:dcc1638c-e90d-4dcb-bf3b-8fa7767bfbb0',
20
+ call_display_name: '',
21
+ created_by_display_name: 'tommaso',
22
+ created_by_id: 'tommaso-03dcddb7-e9e2-42ec-b2f3-5043aac666ee',
23
+ receiver_id: 'martin-21824f17-319b-401b-a61b-fcab646f0d3f',
24
+ sender: 'stream.video',
25
+ type: 'call.live_started',
26
+ version: 'v2'
27
+ },
28
+ // other stuff
29
+ }
30
+ */
31
+ if (Platform.OS !== 'android') return;
32
+ const nativeLog = (message, level = 'debug') => getCallingxLibIfAvailable()?.log(`[callingx - onRingNotificationReceived]: ${message}`, level);
33
+ const pushConfig = StreamVideoRN.getConfig().push;
34
+ if (!pushConfig || !data || data.sender !== 'stream.video' || data.type !== 'call.ring') {
35
+ return;
36
+ }
37
+ const call_cid = data.call_cid;
38
+ const callingx = getCallingxLib();
39
+ if (pushUnsubscriptionCallbacks.has(call_cid)) {
40
+ nativeLog(`call_cid ${call_cid} is already being watched, skipping the duplicate call.ring notification`);
41
+ return;
42
+ }
43
+ const asForegroundService = canListenToWS();
44
+ const backgroundTaskOwner = `push:${call_cid}`;
45
+ nativeLog(`call.ring for callCid: ${call_cid} asForegroundService=${asForegroundService}`);
46
+ const finishBackgroundTask = () => {
47
+ nativeLog(`Finishing background task for callCid: ${call_cid}`);
48
+ callingx.releaseBackgroundTask(backgroundTaskOwner);
49
+ };
50
+ if (asForegroundService) {
51
+ // initialize the callback array immediately to avoid race condition
52
+ pushUnsubscriptionCallbacks.set(call_cid, []);
53
+ // The owner is added synchronously inside acquireBackgroundTask (before its own await), so it
54
+ // is registered immediately even though we don't await the returned promise here.
55
+ nativeLog(`acquiring background task for callCid: ${call_cid}`);
56
+ callingx.acquireBackgroundTask(backgroundTaskOwner).catch(e => {
57
+ nativeLog(`Failed to acquire background task for callCid: ${call_cid} error: ${e}`, 'error');
58
+ });
59
+ }
60
+ let client;
61
+ try {
62
+ client = await pushConfig.createStreamVideoClient();
63
+ if (!client) {
64
+ nativeLog(`video client not found, skipping the call.ring notification`);
65
+ if (asForegroundService) {
66
+ finishBackgroundTask();
67
+ }
68
+ await callingx.stopService();
69
+ pushUnsubscriptionCallbacks.delete(call_cid);
70
+ return;
71
+ }
72
+ } catch (error) {
73
+ //we need to release the background task and stop the service to avoid stale owner
74
+ nativeLog(`Failed to create video client: ${error}`, 'error');
75
+ if (asForegroundService) {
76
+ finishBackgroundTask();
77
+ }
78
+ await callingx.stopService();
79
+ pushUnsubscriptionCallbacks.delete(call_cid);
80
+ return;
81
+ }
82
+ if (asForegroundService) {
83
+ // Listen to call events from WS with the keep-alive headless task, bound to the call service.
84
+ (async () => {
85
+ try {
86
+ nativeLog(`onRingingCall (fg service) for callCid: ${call_cid}`);
87
+ const callFromPush = await client.onRingingCall(call_cid);
88
+ const {
89
+ mustEndCall,
90
+ endCallReason
91
+ } = shouldCallBeClosed(callFromPush, data);
92
+ if (mustEndCall) {
93
+ nativeLog(`Closing fg service callCid: ${call_cid} endCallReason: ${endCallReason}`);
94
+ callingx.endCallWithReason(call_cid, endCallReason);
95
+ callFromPush.leave({
96
+ reject: false
97
+ }).catch(error => {
98
+ nativeLog(`Failed to leave already-ended ringing call ${call_cid}: ${error}`, 'error');
99
+ });
100
+ finishBackgroundTask();
101
+ pushUnsubscriptionCallbacks.delete(call_cid);
102
+ return;
103
+ }
104
+
105
+ // prevent subscriptions in case of call being left and subscriptions being already cleared
106
+ const unsubscribeFunctions = pushUnsubscriptionCallbacks.get(call_cid);
107
+ if (!unsubscribeFunctions) {
108
+ nativeLog(`ring cancelled during onRingingCall for callCid: ${call_cid}, releasing background task`);
109
+ finishBackgroundTask();
110
+ return;
111
+ }
112
+ nativeLog(`watching WS for ringing callCid: ${call_cid}`);
113
+ // check if service needs to be closed if accept/decline event was done on another device
114
+ const unsubscribe = callFromPush.on('all', event => {
115
+ const _canListenToWS = canListenToWS();
116
+ if (!_canListenToWS) {
117
+ nativeLog(`Closing fg service from event ${event.type} callCid: ${call_cid} canListenToWS: ${_canListenToWS}`);
118
+ unsubscribeFunctions.forEach(fn => fn());
119
+ return;
120
+ }
121
+ const {
122
+ mustEndCall: mustEndCallFromEvent,
123
+ endCallReason: endCallReasonFromEvent
124
+ } = shouldCallBeClosed(callFromPush, data);
125
+ if (mustEndCallFromEvent) {
126
+ nativeLog(`Closing fg service from event ${event.type} callCid: ${call_cid} shouldCallBeClosed`);
127
+ callingx.endCallWithReason(call_cid, endCallReasonFromEvent);
128
+ unsubscribeFunctions.forEach(fn => fn());
129
+ }
130
+ });
131
+
132
+ // check if service needs to be closed if call was left
133
+ const stateSubscription = callFromPush.state.callingState$.subscribe(callingState => {
134
+ if (callingState === CallingState.IDLE || callingState === CallingState.LEFT) {
135
+ nativeLog(`Closing fg service from callingState callCid: ${call_cid} callingState: ${callingState}`);
136
+ unsubscribeFunctions.forEach(fn => fn());
137
+ }
138
+ });
139
+
140
+ //stop background task when app comes to foreground
141
+ const appStateSubscription = AppState.addEventListener('change', nextAppState => {
142
+ const _canListenToWS = canListenToWS();
143
+ nativeLog(`AppState changed to: ${nextAppState} for callCid: ${call_cid} canListenToWS: ${_canListenToWS}`);
144
+ if (!_canListenToWS) {
145
+ unsubscribeFunctions.forEach(fn => fn());
146
+ return;
147
+ }
148
+ });
149
+ unsubscribeFunctions.push(unsubscribe);
150
+ unsubscribeFunctions.push(() => stateSubscription.unsubscribe());
151
+ unsubscribeFunctions.push(() => appStateSubscription.remove());
152
+ unsubscribeFunctions.push(finishBackgroundTask);
153
+ unsubscribeFunctions.push(() => pushUnsubscriptionCallbacks.delete(call_cid));
154
+ nativeLog(`WS subscriptions registered for callCid: ${call_cid}`);
155
+ } catch (error) {
156
+ nativeLog(`Failed to start background task with callCid: ${call_cid} error: ${error}`, 'error');
157
+ pushUnsubscriptionCallbacks.delete(call_cid);
158
+ finishBackgroundTask();
159
+ }
160
+ })();
161
+ }
162
+ if (asForegroundService) {
163
+ // no need to check if call has be closed as that will be handled by the fg service
164
+ return;
165
+ }
166
+ nativeLog(`onRingingCall (foreground) for callCid: ${call_cid}`);
167
+ const callFromPush = await client.onRingingCall(call_cid);
168
+ const {
169
+ mustEndCall,
170
+ endCallReason
171
+ } = shouldCallBeClosed(callFromPush, data);
172
+ if (mustEndCall) {
173
+ nativeLog(`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`);
174
+ callingx.endCallWithReason(call_cid, endCallReason);
175
+ callFromPush.leave({
176
+ reject: false
177
+ }).catch(error => {
178
+ nativeLog(`Failed to leave already-ended ringing call ${call_cid}: ${error}`, 'error');
179
+ });
180
+ }
181
+ };
182
+ //# sourceMappingURL=android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CallingState","AppState","Platform","getCallingxLib","getCallingxLibIfAvailable","StreamVideoRN","pushUnsubscriptionCallbacks","canListenToWS","shouldCallBeClosed","onRingNotificationReceived","data","OS","nativeLog","message","level","log","pushConfig","getConfig","push","sender","type","call_cid","callingx","has","asForegroundService","backgroundTaskOwner","finishBackgroundTask","releaseBackgroundTask","set","acquireBackgroundTask","catch","e","client","createStreamVideoClient","stopService","delete","error","callFromPush","onRingingCall","mustEndCall","endCallReason","endCallWithReason","leave","reject","unsubscribeFunctions","get","unsubscribe","on","event","_canListenToWS","forEach","fn","mustEndCallFromEvent","endCallReasonFromEvent","stateSubscription","state","callingState$","subscribe","callingState","IDLE","LEFT","appStateSubscription","addEventListener","nextAppState","remove"],"sourceRoot":"../../../../../src","sources":["utils/push/internal/android.ts"],"mappings":";;AAAA,SAGEA,YAAY,QAEP,yBAAyB;AAChC,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AACjD,SAEEC,cAAc,EACdC,yBAAyB,QACpB,SAAS;AAChB,SAASC,aA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AC,OAAOe,KAAK,EAAE;QACdxB,SAAS,CACP,iDAAiDS,QAAQ,WAAWe,KAAK,EAAE,EAC3E,OACF,CAAC;QACD9B,2BAA2B,CAAC6B,MAAM,CAACd,QAAQ,CAAC;QAC5CK,oBAAoB,CAAC,CAAC;MACxB;IACF,CAAC,EAAE,CAAC;EACN;EAEA,IAAIF,mBAAmB,EAAE;IACvB;IACA;EACF;EAEAZ,SAAS,CAAC,2CAA2CS,QAAQ,EAAE,CAAC;EAChE,MAAMgB,YAAY,GAAG,MAAML,MAAM,CAACM,aAAa,CAACjB,QAAQ,CAAC;EAEzD,MAAM;IAAEkB,WAAW;IAAEC;EAAc,CAAC,GAAGhC,kBAAkB,CAAC6B,YAAY,EAAE3B,IAAI,CAAC;EAC7E,IAAI6B,WAAW,EAAE;IACf3B,SAAS,CACP,iEAAiES,QAAQ,yBAC3E,CAAC;IACDC,QAAQ,CAACmB,iBAAiB,CAACpB,QAAQ,EAAEmB,aAAa,CAAC;IACnDH,YAAY,CAACK,KAAK,CAAC;MAAEC,MAAM,EAAE;IAAM,CAAC,CAAC,CAACb,KAAK,CAAEM,KAAK,IAAK;MACrDxB,SAAS,CACP,8CAA8CS,QAAQ,KAAKe,KAAK,EAAE,EAClE,OACF,CAAC;IACH,CAAC,CAAC;EACJ;AACF,CAAC","ignoreList":[]}
@@ -2,10 +2,18 @@
2
2
 
3
3
  import { lib } from './lib';
4
4
  const INSTALLATION_INSTRUCTION = 'Please see https://rnfirebase.io/messaging/usage#installation for installation instructions';
5
- export function getFirebaseMessagingLib() {
5
+ function getFirebaseMessagingModule() {
6
6
  if (!lib) {
7
7
  throw Error('@react-native-firebase/messaging is not installed. ' + INSTALLATION_INSTRUCTION);
8
8
  }
9
9
  return lib;
10
10
  }
11
+ export function getFirebaseMessagingLib() {
12
+ const messagingModule = getFirebaseMessagingModule();
13
+ const messaging = messagingModule.getMessaging();
14
+ return () => ({
15
+ getToken: () => messagingModule.getToken(messaging),
16
+ onTokenRefresh: listener => messagingModule.onTokenRefresh(messaging, listener)
17
+ });
18
+ }
11
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["lib","INSTALLATION_INSTRUCTION","getFirebaseMessagingLib","Error"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/firebaseMessaging/index.ts"],"mappings":";;AAAA,SAASA,GAAG,QAAmB,OAAO;AAKtC,MAAMC,wBAAwB,GAC5B,6FAA6F;AAE/F,OAAO,SAASC,uBAAuBA,CAAA,EAA0B;EAC/D,IAAI,CAACF,GAAG,EAAE;IACR,MAAMG,KAAK,CACT,qDAAqD,GACnDF,wBACJ,CAAC;EACH;EACA,OAAOD,GAAG;AACZ","ignoreList":[]}
1
+ {"version":3,"names":["lib","INSTALLATION_INSTRUCTION","getFirebaseMessagingModule","Error","getFirebaseMessagingLib","messagingModule","messaging","getMessaging","getToken","onTokenRefresh","listener"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/firebaseMessaging/index.ts"],"mappings":";;AAAA,SAASA,GAAG,QAA8B,OAAO;AAEjD,MAAMC,wBAAwB,GAC5B,6FAA6F;AAM/F,SAASC,0BAA0BA,CAAA,EAAG;EACpC,IAAI,CAACF,GAAG,EAAE;IACR,MAAMG,KAAK,CACT,qDAAqD,GACnDF,wBACJ,CAAC;EACH;EACA,OAAOD,GAAG;AACZ;AAEA,OAAO,SAASI,uBAAuBA,CAAA,EAAG;EACxC,MAAMC,eAAe,GAAGH,0BAA0B,CAAC,CAAC;EACpD,MAAMI,SAAS,GAAGD,eAAe,CAACE,YAAY,CAAC,CAAC;EAChD,OAAO,OAAO;IACZC,QAAQ,EAAEA,CAAA,KAAMH,eAAe,CAACG,QAAQ,CAACF,SAAS,CAAC;IACnDG,cAAc,EAAGC,QAAiC,IAChDL,eAAe,CAACI,cAAc,CAACH,SAAS,EAAEI,QAAQ;EACtD,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -2,7 +2,7 @@
2
2
 
3
3
  let lib;
4
4
  try {
5
- lib = require('@react-native-firebase/messaging').default;
5
+ lib = require('@react-native-firebase/messaging');
6
6
  } catch {}
7
7
  export { lib };
8
8
 
@@ -1 +1 @@
1
- {"version":3,"names":["lib","require","default"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/firebaseMessaging/lib.ts"],"mappings":";;AAEA,IAAIA,GAAqB;AAEzB,IAAI;EACFA,GAAG,GAAGC,OAAO,CAAC,kCAAkC,CAAC,CAACC,OAAO;AAC3D,CAAC,CAAC,MAAM,CAAC;AAET,SAASF,GAAG;;AAEZ;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["lib","require"],"sourceRoot":"../../../../../../src","sources":["utils/push/libs/firebaseMessaging/lib.ts"],"mappings":";;AAEA,IAAIA,GAAgC;AAEpC,IAAI;EACFA,GAAG,GAAGC,OAAO,CAAC,kCAAkC,CAAC;AACnD,CAAC,CAAC,MAAM,CAAC;AAET,SAASD,GAAG;;AAEZ;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ import { Platform } from 'react-native';
4
+ import { videoLoggerSystem } from '@stream-io/video-client';
5
+ import { getCallingxLib } from './libs';
6
+ import { onRingNotificationReceived } from './internal/android';
7
+ export function setupAndroidPushEvents(pushConfig) {
8
+ const logger = videoLoggerSystem.getLogger('setupAndroidPushEvents');
9
+ if (Platform.OS !== 'android' || !pushConfig.android?.pushProviderName) {
10
+ logger.debug(`setupAndroidPushEvents skipped: platform=${Platform.OS} pushProviderName=${pushConfig.android?.pushProviderName}`);
11
+ return;
12
+ }
13
+ const callingx = getCallingxLib();
14
+ callingx.addEventListener('ringCallPushReceived', params => {
15
+ logger.debug(`ringCallPushReceived event call_cid: ${params?.call_cid}`);
16
+ onRingNotificationReceived(params).catch(error => {
17
+ logger.error(`Error in onRingNotificationReceived: ${error}`);
18
+ });
19
+ });
20
+ }
21
+ //# sourceMappingURL=setupAndroidPushEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Platform","videoLoggerSystem","getCallingxLib","onRingNotificationReceived","setupAndroidPushEvents","pushConfig","logger","getLogger","OS","android","pushProviderName","debug","callingx","addEventListener","params","call_cid","catch","error"],"sourceRoot":"../../../../src","sources":["utils/push/setupAndroidPushEvents.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,iBAAiB,QAAQ,yBAAyB;AAE3D,SAASC,cAAc,QAAQ,QAAQ;AACvC,SAASC,0BAA0B,QAAQ,oBAAoB;AAE/D,OAAO,SAASC,sBAAsBA,CACpCC,UAAkD,EAClD;EACA,MAAMC,MAAM,GAAGL,iBAAiB,CAACM,SAAS,CAAC,wBAAwB,CAAC;EACpE,IAAIP,QAAQ,CAACQ,EAAE,KAAK,SAAS,IAAI,CAACH,UAAU,CAACI,OAAO,EAAEC,gBAAgB,EAAE;IACtEJ,MAAM,CAACK,KAAK,CACV,4CAA4CX,QAAQ,CAACQ,EAAE,qBAAqBH,UAAU,CAACI,OAAO,EAAEC,gBAAgB,EAClH,CAAC;IACD;EACF;EAEA,MAAME,QAAQ,GAAGV,cAAc,CAAC,CAAC;EACjCU,QAAQ,CAACC,gBAAgB,CAAC,sBAAsB,EAAGC,MAAM,IAAK;IAC5DR,MAAM,CAACK,KAAK,CAAC,wCAAwCG,MAAM,EAAEC,QAAQ,EAAE,CAAC;IACxEZ,0BAA0B,CAACW,MAAM,CAAC,CAACE,KAAK,CAAEC,KAAK,IAAK;MAClDX,MAAM,CAACW,KAAK,CAAC,wCAAwCA,KAAK,EAAE,CAAC;IAC/D,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -4,6 +4,7 @@ import { CallingState, videoLoggerSystem } from '@stream-io/video-client';
4
4
  import { clearPushWSEventSubscriptions, processCallFromPushInBackground } from './internal/utils';
5
5
  import { getCallingxLib } from './libs/callingx';
6
6
  import { Platform } from 'react-native';
7
+ import { onRingNotificationReceived } from './internal/android';
7
8
  const logger = videoLoggerSystem.getLogger('callingx');
8
9
 
9
10
  /**
@@ -36,11 +37,10 @@ export function setupCallingExpEvents(pushConfig) {
36
37
  eventName,
37
38
  params
38
39
  } = event;
40
+ logger.debug(`${eventName} delayed event`);
39
41
  if (eventName === 'answerCall') {
40
- logger.debug(`answerCall delayed event callId: ${params?.callId}`);
41
42
  onAcceptCall(pushConfig)(params);
42
43
  } else if (eventName === 'endCall') {
43
- logger.debug(`endCall delayed event callId: ${params?.callId}`);
44
44
  onEndCall(pushConfig)(params);
45
45
  } else if (eventName === 'didActivateAudioSession') {
46
46
  onDidActivateAudioSession();
@@ -48,6 +48,10 @@ export function setupCallingExpEvents(pushConfig) {
48
48
  onDidDeactivateAudioSession();
49
49
  } else if (eventName === 'providerReset') {
50
50
  onProviderReset(pushConfig)(params);
51
+ } else if (eventName === 'ringCallPushReceived') {
52
+ onRingNotificationReceived(params).catch(error => {
53
+ logger.error(`Error in onRingNotificationReceived: ${error}`);
54
+ });
51
55
  }
52
56
  });
53
57
  }
@@ -1 +1 @@
1
- {"version":3,"names":["CallingState","videoLoggerSystem","clearPushWSEventSubscriptions","processCallFromPushInBackground","getCallingxLib","Platform","logger","getLogger","setupCallingExpEvents","pushConfig","hasPushProvider","OS","android","pushProviderName","ios","hasOngoingCalls","enableOngoingCalls","callingx","addEventListener","params","onAcceptCall","onEndCall","onDidActivateAudioSession","onDidDeactivateAudioSession","onProviderReset","events","getInitialEvents","forEach","event","eventName","debug","callId","callCids","join","length","videoClient","createStreamVideoClient","e","error","cid","call","state","calls","find","c","callingState","LEFT","leave","catch","call_cid","source","didFail","fulfillAnswerCallAction","fulfillEndCallAction"],"sourceRoot":"../../../../src","sources":["utils/push/setupCallingExpEvents.ts"],"mappings":";;AAAA,SACEA,YAAY,EACZC,iBAAiB,QAEZ,yBAAyB;AAEhC,SACEC,6BAA6B,EAC7BC,+BAA+B,QAC1B,kBAAkB;AACzB,SACEC,cAAc,QAGT,iBAAiB;AACxB,SAASC,QAAQ,QAAQ,cAAc;AAIvC,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AAC;EAEvE,IAAIA,MAAM,KAAK,KAAK,IAAI,CAACD,QAAQ,EAAE;IACjC;IACA;EACF;EAEA,MAAMhC,QAAQ,GAAGb,cAAc,CAAC,CAAC;EACjCF,6BAA6B,CAAC+C,QAAQ,CAAC;EACvC9C,+BAA+B,CAC7BM,UAAU,EACVwC,QAAQ,EACR,SAAS,EACRE,OAAO,IAAK;IACXlC,QAAQ,CAACoC,oBAAoB,CAACJ,QAAQ,EAAEE,OAAO,CAAC;EAClD,CACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["CallingState","videoLoggerSystem","clearPushWSEventSubscriptions","processCallFromPushInBackground","getCallingxLib","Platform","onRingNotificationReceived","logger","getLogger","setupCallingExpEvents","pushConfig","hasPushProvider","OS","android","pushProviderName","ios","hasOngoingCalls","enableOngoingCalls","callingx","addEventListener","params","onAcceptCall","onEndCall","onDidActivateAudioSession","onDidDeactivateAudioSession","onProviderReset","events","getInitialEvents","forEach","event","eventName","debug","catch","error","callCids","join","length","videoClient","createStreamVideoClient","e","cid","call","state","calls","find","c","callingState","LEFT","leave","callId","call_cid","source","didFail","fulfillAnswerCallAction","fulfillEndCallAction"],"sourceRoot":"../../../../src","sources":["utils/push/setupCallingExpEvents.ts"],"mappings":";;AAAA,SACEA,YAAY,EACZC,iBAAiB,QAEZ,yBAAyB;AAEhC,SACEC,6BAA6B,EAC7BC,+BAA+B,QAC1B,kBAAkB;AACzB,SACEC,cAAc,QAGT,iBAAiB;AACxB,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,0BAA0B,QAAQ,oBAAoB;AAI/D,MAAMC,MAAM,GAAGN,iBAAiB,CAACO,SAAS,CAAC,UAAU,CAAC;;AAEtD;AACA;AACA;AACA,OAAO,SAASC,qBAAqBA,CAACC,UAAmC,EAAE;EACzE,MAAMC,eAAe,GAClBN,QAAQ,CAACO,EAAE,KAAK,SAAS,IAAIF,UAAU,CAACG,OAAO,EAAEC,gBAAgB,IACjET,QAAQ,C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CAAC;EACjCF,6BAA6B,CAACgD,QAAQ,CAAC;EACvC/C,+BAA+B,CAC7BO,UAAU,EACVwC,QAAQ,EACR,SAAS,EACRE,OAAO,IAAK;IACXlC,QAAQ,CAACoC,oBAAoB,CAACJ,QAAQ,EAAEE,OAAO,CAAC;EAClD,CACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -7,18 +7,17 @@ import { onVoipNotificationReceived } from './internal/ios';
7
7
  import { videoLoggerSystem } from '@stream-io/video-client';
8
8
  import { getCallingxLib } from './libs';
9
9
  export function setupIosVoipPushEvents(pushConfig) {
10
- if (Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName) {
11
- return;
12
- }
13
10
  const logger = videoLoggerSystem.getLogger('setupIosVoipPushEvents');
14
- if (!pushConfig.ios.pushProviderName) {
15
- // TODO: remove this check and find a better way once we have telecom integration for android
16
- logger.debug('ios pushProviderName is not defined, so skipping the setupIosVoipPushEvents');
11
+ if (Platform.OS !== 'ios' || !pushConfig.ios?.pushProviderName) {
12
+ logger.debug(`setupIosVoipPushEvents skipped: platform=${Platform.OS} pushProviderName=${pushConfig.ios?.pushProviderName}`);
17
13
  return;
18
14
  }
19
15
  const callingx = getCallingxLib();
20
16
  callingx.addEventListener('voipNotificationReceived', params => {
21
- onVoipNotificationReceived(params, pushConfig);
17
+ logger.debug(`voipNotificationReceived event call_cid: ${params?.stream?.call_cid}`);
18
+ onVoipNotificationReceived(params, pushConfig).catch(error => {
19
+ logger.error(`Error in onVoipNotificationReceived: ${error}`);
20
+ });
22
21
  });
23
22
  }
24
23
  //# sourceMappingURL=setupIosVoipPushEvents.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Platform","onVoipNotificationReceived","videoLoggerSystem","getCallingxLib","setupIosVoipPushEvents","pushConfig","OS","ios","pushProviderName","logger","getLogger","debug","callingx","addEventListener","params"],"sourceRoot":"../../../../src","sources":["utils/push/setupIosVoipPushEvents.ts"],"mappings":";;AAAA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,0BAA0B,QAAQ,gBAAgB;AAE3D,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,cAAc,QAAQ,QAAQ;AAEvC,OAAO,SAASC,sBAAsBA,CACpCC,UAAkD,EAClD;EACA,IAAIL,QAAQ,CAACM,EAAE,KAAK,KAAK,IAAI,CAACD,UAAU,CAACE,GAAG,EAAEC,gBAAgB,EAAE;IAC9D;EACF;EACA,MAAMC,MAAM,GAAGP,iBAAiB,CAACQ,SAAS,CAAC,wBAAwB,CAAC;EACpE,IAAI,CAACL,UAAU,CAACE,GAAG,CAACC,gBAAgB,EAAE;IACpC;IACAC,MAAM,CAACE,KAAK,CACV,6EACF,CAAC;IACD;EACF;EAEA,MAAMC,QAAQ,GAAGT,cAAc,CAAC,CAAC;EACjCS,QAAQ,CAACC,gBAAgB,CAAC,0BAA0B,EAAGC,MAAM,IAAK;IAChEb,0BAA0B,CAACa,MAAM,EAAET,UAAU,CAAC;EAChD,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["Platform","onVoipNotificationReceived","videoLoggerSystem","getCallingxLib","setupIosVoipPushEvents","pushConfig","logger","getLogger","OS","ios","pushProviderName","debug","callingx","addEventListener","params","stream","call_cid","catch","error"],"sourceRoot":"../../../../src","sources":["utils/push/setupIosVoipPushEvents.ts"],"mappings":";;AAAA;;AAEA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,0BAA0B,QAAQ,gBAAgB;AAE3D,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,cAAc,QAAQ,QAAQ;AAEvC,OAAO,SAASC,sBAAsBA,CACpCC,UAAkD,EAClD;EACA,MAAMC,MAAM,GAAGJ,iBAAiB,CAACK,SAAS,CAAC,wBAAwB,CAAC;EACpE,IAAIP,QAAQ,CAACQ,EAAE,KAAK,KAAK,IAAI,CAACH,UAAU,CAACI,GAAG,EAAEC,gBAAgB,EAAE;IAC9DJ,MAAM,CAACK,KAAK,CACV,4CAA4CX,QAAQ,CAACQ,EAAE,qBAAqBH,UAAU,CAACI,GAAG,EAAEC,gBAAgB,EAC9G,CAAC;IACD;EACF;EAEA,MAAME,QAAQ,GAAGT,cAAc,CAAC,CAAC;EACjCS,QAAQ,CAACC,gBAAgB,CAAC,0BAA0B,EAAGC,MAAM,IAAK;IAChER,MAAM,CAACK,KAAK,CACV,4CAA4CG,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EACtE,CAAC;IACDf,0BAA0B,CAACa,MAAM,EAAET,UAAU,CAAC,CAACY,KAAK,CAAEC,KAAK,IAAK;MAC9DZ,MAAM,CAACY,KAAK,CAAC,wCAAwCA,KAAK,EAAE,CAAC;IAC/D,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["isFirebaseStreamVideoMessage","message","data","sender"],"sourceRoot":"../../../../src","sources":["utils/push/utils.ts"],"mappings":";;AAWA,OAAO,SAASA,4BAA4BA,CAC1CC,OAA6C,EAC7C;EACA,OAAOA,OAAO,CAACC,IAAI,EAAEC,MAAM,KAAK,cAAc;AAChD","ignoreList":[]}
1
+ {"version":3,"names":["isFirebaseStreamVideoMessage","message","data","sender"],"sourceRoot":"../../../../src","sources":["utils/push/utils.ts"],"mappings":";;AAWA,OAAO,SAASA,4BAA4BA,CAACC,OAA8B,EAAE;EAC3E,OAAOA,OAAO,CAACC,IAAI,EAAEC,MAAM,KAAK,cAAc;AAChD","ignoreList":[]}
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
 
3
- export const version = '1.44.0';
3
+ export const version = '1.45.0';
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCallingExpWithCallingStateEffect.d.ts","sourceRoot":"","sources":["../../../../src/hooks/push/useCallingExpWithCallingStateEffect.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,eAAO,MAAM,mCAAmC,YAiR/C,CAAC"}
1
+ {"version":3,"file":"useCallingExpWithCallingStateEffect.d.ts","sourceRoot":"","sources":["../../../../src/hooks/push/useCallingExpWithCallingStateEffect.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,eAAO,MAAM,mCAAmC,YAwR/C,CAAC"}
@@ -1,85 +1,28 @@
1
+ import { type LoopbackTracks } from '@stream-io/video-client';
1
2
  export type LoopbackRecordingState = 'idle' | 'awaiting-streams' | 'recording';
2
- export type ResolvedStreams = {
3
- audioTrack?: MediaStreamTrack;
4
- videoTrack?: MediaStreamTrack;
5
- };
3
+ export type ResolvedStreams = LoopbackTracks;
6
4
  export interface StartLoopbackRecordingOptions {
7
- /**
8
- * Whether to include the loopback video track in the recording.
9
- * Defaults to `true`. Set to `false` for an audio-only recording.
10
- * Audio is always recorded — there is no video-only mode.
11
- */
5
+ /** Whether to include loopback video. Audio is always recorded. */
12
6
  includeVideo?: boolean;
13
- /**
14
- * Maximum recording duration in milliseconds, after which the
15
- * recording auto-stops and finalises the file.
16
- *
17
- * Defaults to `10_000` (10 seconds). Clamped to
18
- * `[5_000, 120_000]` (5 seconds — 2 minutes).
19
- */
7
+ /** Maximum recording duration in milliseconds. */
20
8
  maxDurationMs?: number;
21
9
  }
22
10
  export interface UseLoopbackRecordingResult {
23
- /**
24
- * Start a recording. The hook waits internally for the SFU loopback
25
- * streams to arrive on `localParticipant`, then begins recording.
26
- *
27
- * The returned promise resolves with the produced `file://` URI **at
28
- * the recording's terminal moment** — whether that is the auto-stop
29
- * timer expiring, an explicit `stopRecording` call, or a cleanup-
30
- * driven stop on unmount/leave. Resolves with `null` if no file was
31
- * produced (writer torn down before any buffer arrived, or
32
- * `stopRecording` was called while still awaiting streams). Rejects
33
- * on a fatal error, if a recording is already running, or if the
34
- * stream-wait times out.
35
- */
11
+ /** Starts recording and resolves with a `file://` URI. */
36
12
  startRecording: (options?: StartLoopbackRecordingOptions) => Promise<string | null>;
37
- /**
38
- * Signal an early termination. While `awaiting-streams` this aborts
39
- * the wait and the pending `startRecording` resolves with `null`.
40
- * While `recording` this signals native finalisation and resolves
41
- * once it completes.
42
- */
13
+ /** Stops the current recording or stream wait. */
43
14
  stopRecording: () => Promise<void>;
44
- /**
45
- * Recursively delete every file under the SDK's recordings directory.
46
- */
15
+ /** Deletes all SDK recording files. */
47
16
  clearRecordings: () => Promise<void>;
48
- /**
49
- * List every `file://` URI in the SDK's recordings directory, sorted
50
- * most-recent first. Returns an empty array if the directory doesn't
51
- * exist yet.
52
- */
17
+ /** Lists SDK recording file URIs. */
53
18
  getRecordings: () => Promise<string[]>;
54
- /**
55
- * Lifecycle phase of the recording, owned by the hook:
56
- * - `'idle'`: no recording in progress.
57
- * - `'awaiting-streams'`: `startRecording` was called but the SFU
58
- * has not yet echoed the loopback tracks back.
59
- * - `'recording'`: native pipeline is actively writing.
60
- */
19
+ /** Lifecycle phase of the recording. */
61
20
  recordingState: LoopbackRecordingState;
62
- /**
63
- * The SFU loopback video stream on the local participant, when
64
- * present. Identified by reference inequality against
65
- * `call.camera.state.mediaStream`.
66
- */
21
+ /** SFU-echoed video stream on the local participant. */
67
22
  loopbackVideoStream?: MediaStream;
68
- /**
69
- * The SFU loopback audio stream on the local participant, when
70
- * present. Identified by reference inequality against
71
- * `call.microphone.state.mediaStream`.
72
- */
23
+ /** SFU-echoed audio stream on the local participant. */
73
24
  loopbackAudioStream?: MediaStream;
74
25
  }
75
- /**
76
- * Records the SFU loopback streams (audio + video) on the local participant
77
- * to a local MP4 file. Designed for the `allowOwnTracksLoopback` pre-call test mode:
78
- * the SFU echoes the caller's published tracks back through the Subscriber
79
- * peer connection. The hook identifies the loopback streams on the local
80
- * participant by reference inequality against
81
- * `call.camera.state.mediaStream` / `call.microphone.state.mediaStream` —
82
- * the canonical references to the local capture — and captures them.
83
- */
26
+ /** Records SFU loopback streams to a local MP4 file. */
84
27
  export declare function useLoopbackRecording(): UseLoopbackRecordingResult;
85
28
  //# sourceMappingURL=useLoopbackRecording.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLoopbackRecording.d.ts","sourceRoot":"","sources":["../../../src/hooks/useLoopbackRecording.ts"],"names":[],"mappings":"AA4BA,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,kBAAkB,GAAG,WAAW,CAAC;AAE/E,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B,CAAC;AAEF,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;;;;OAYG;IACH,cAAc,EAAE,CACd,OAAO,CAAC,EAAE,6BAA6B,KACpC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5B;;;;;OAKG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC;;OAEG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC;;;;OAIG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC;;;;;;OAMG;IACH,cAAc,EAAE,sBAAsB,CAAC;IACvC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,WAAW,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,IAAI,0BAA0B,CA6NjE"}
1
+ {"version":3,"file":"useLoopbackRecording.d.ts","sourceRoot":"","sources":["../../../src/hooks/useLoopbackRecording.ts"],"names":[],"mappings":"AAEA,OAAO,EAUL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAOjC,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,kBAAkB,GAAG,WAAW,CAAC;AAE/E,MAAM,MAAM,eAAe,GAA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YAAY;IASnB,MAAM,CAAC,wBAAwB;IAI/B;;OAEG;WACU,YAAY;IAIzB;;OAEG;WACU,YAAY;IAIzB;;;OAGG;WACU,6BAA6B,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ9D;;;OAGG;WACU,4BAA4B,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ7D;;;OAGG;WACU,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC;CAO1D"}
@@ -1,13 +1,12 @@
1
1
  import { StreamVideoClient } from '@stream-io/video-client';
2
2
  import type { StreamVideoConfig } from '../StreamVideoRN/types';
3
- import { type FirebaseMessagingTypes } from './libs';
4
3
  type PushConfig = NonNullable<StreamVideoConfig['push']>;
5
4
  /** Send token to stream */
6
5
  export declare function initAndroidPushToken(client: StreamVideoClient, pushConfig: PushConfig, setUnsubscribeListener: (unsubscribe: () => void) => void): Promise<void>;
7
6
  /**
8
- * Creates notification from the push message data.
9
- * For Ringing and Non-Ringing calls.
7
+ * @deprecated Ring notifications are now handled by the SDK internally. This method is a no-op;
8
+ * you can safely remove `firebaseDataHandler(...)` wiring from your Firebase messaging handlers.
10
9
  */
11
- export declare const firebaseDataHandler: (data: FirebaseMessagingTypes.RemoteMessage["data"]) => Promise<void>;
10
+ export declare const firebaseDataHandler: (data?: any) => Promise<void>;
12
11
  export {};
13
12
  //# sourceMappingURL=android.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/android.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAElB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,KAAK,sBAAsB,EAA2B,MAAM,QAAQ,CAAC;AAO9E,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAIzD,4BAA4B;AAC5B,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,KAAK,IAAI,iBA4C1D;AAED;;;GAGG;AAEH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,sBAAsB,CAAC,aAAa,CAAC,MAAM,CAAC,kBAgOnD,CAAC"}
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAqB,MAAM,yBAAyB,CAAC;AAE/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAIhE,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAIzD,4BAA4B;AAC5B,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,KAAK,IAAI,iBA4C1D;AAGD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAU,OAAO,GAAG,kBAQnD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type FirebaseRemoteMessage } from '../libs';
2
+ /**
3
+ * Handles a Stream Video `call.ring` push payload: connects the WS to watch the ringing call
4
+ * and auto-dismisses it if it has already ended/been handled elsewhere. Non-ringing types are
5
+ * ignored (their display is app responsibility). Android-only; a no-op on other platforms.
6
+ */
7
+ export declare const onRingNotificationReceived: (data: FirebaseRemoteMessage["data"]) => Promise<void>;
8
+ //# sourceMappingURL=android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/android.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,qBAAqB,EAG3B,MAAM,SAAS,CAAC;AAKjB;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACrC,MAAM,qBAAqB,CAAC,MAAM,CAAC,kBAqOpC,CAAC"}
@@ -1,5 +1,7 @@
1
- import { type Type } from './lib';
2
- export type { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
3
- export type FirebaseMessagingType = Type;
4
- export declare function getFirebaseMessagingLib(): FirebaseMessagingType;
1
+ import { type MessagingModule } from './lib';
2
+ export type FirebaseRemoteMessage = NonNullable<Awaited<ReturnType<MessagingModule['getInitialNotification']>>>;
3
+ export declare function getFirebaseMessagingLib(): () => {
4
+ getToken: () => Promise<string>;
5
+ onTokenRefresh: (listener: (token: string) => void) => () => void;
6
+ };
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/push/libs/firebaseMessaging/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;AAEvC,YAAY,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAKzC,wBAAgB,uBAAuB,IAAI,qBAAqB,CAQ/D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/push/libs/firebaseMessaging/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,eAAe,EAAE,MAAM,OAAO,CAAC;AAKlD,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAC7C,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAC/D,CAAC;AAYF,wBAAgB,uBAAuB;;+BAKR,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;EAGrD"}
@@ -1,4 +1,4 @@
1
- export type Type = typeof import('@react-native-firebase/messaging').default;
2
- declare let lib: Type | undefined;
1
+ export type MessagingModule = typeof import('@react-native-firebase/messaging');
2
+ declare let lib: MessagingModule | undefined;
3
3
  export { lib };
4
4
  //# sourceMappingURL=lib.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/push/libs/firebaseMessaging/lib.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,cAAc,kCAAkC,EAAE,OAAO,CAAC;AAE7E,QAAA,IAAI,GAAG,EAAE,IAAI,GAAG,SAAS,CAAC;AAM1B,OAAO,EAAE,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/push/libs/firebaseMessaging/lib.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,cAAc,kCAAkC,CAAC,CAAC;AAEhF,QAAA,IAAI,GAAG,EAAE,eAAe,GAAG,SAAS,CAAC;AAMrC,OAAO,EAAE,GAAG,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { StreamVideoConfig } from '../StreamVideoRN/types';
2
+ export declare function setupAndroidPushEvents(pushConfig: NonNullable<StreamVideoConfig['push']>): void;
3
+ //# sourceMappingURL=setupAndroidPushEvents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupAndroidPushEvents.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/setupAndroidPushEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,QAiBnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"setupCallingExpEvents.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/setupCallingExpEvents.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAYhE,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAIzD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,QAsDxE"}
1
+ {"version":3,"file":"setupCallingExpEvents.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/setupCallingExpEvents.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAahE,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAIzD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,QAyDxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"setupIosVoipPushEvents.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/setupIosVoipPushEvents.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,QAkBnD"}
1
+ {"version":3,"file":"setupIosVoipPushEvents.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/setupIosVoipPushEvents.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAI3D,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,QAmBnD"}
@@ -1,9 +1,9 @@
1
- import type { FirebaseMessagingTypes } from './libs/firebaseMessaging';
1
+ import type { FirebaseRemoteMessage } from './libs/firebaseMessaging';
2
2
  import type { NonRingingPushEvent } from '../StreamVideoRN/types';
3
3
  export type StreamPushPayload = {
4
4
  call_cid: string;
5
5
  type: 'call.ring' | NonRingingPushEvent;
6
6
  sender: string;
7
7
  } | undefined;
8
- export declare function isFirebaseStreamVideoMessage(message: FirebaseMessagingTypes.RemoteMessage): boolean;
8
+ export declare function isFirebaseStreamVideoMessage(message: FirebaseRemoteMessage): boolean;
9
9
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,WAAW,GAAG,mBAAmB,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB,GACD,SAAS,CAAC;AAEd,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,sBAAsB,CAAC,aAAa,WAG9C"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,WAAW,GAAG,mBAAmB,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB,GACD,SAAS,CAAC;AAEd,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,qBAAqB,WAE1E"}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.44.0";
1
+ export declare const version = "1.45.0";
2
2
  //# sourceMappingURL=version.d.ts.map