@stream-io/video-react-native-sdk 0.5.6 → 0.5.8

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 (128) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/commonjs/components/Call/CallControls/ScreenShareButton.js +3 -1
  3. package/dist/commonjs/components/Call/CallControls/ScreenShareButton.js.map +1 -1
  4. package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
  5. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +1 -1
  6. package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  7. package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/index.js +2 -2
  8. package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/index.js.map +1 -1
  9. package/dist/commonjs/hooks/internal/useCallMediaStreamCleanup.js +1 -1
  10. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  11. package/dist/commonjs/utils/index.js.map +1 -1
  12. package/dist/commonjs/utils/internal/{optionalLibs.js → optionallibs/gestureHandler.js} +2 -13
  13. package/dist/commonjs/utils/internal/optionallibs/gestureHandler.js.map +1 -0
  14. package/dist/commonjs/utils/internal/optionallibs/index.js +28 -0
  15. package/dist/commonjs/utils/internal/optionallibs/index.js.map +1 -0
  16. package/dist/commonjs/utils/internal/optionallibs/reanimated.js +18 -0
  17. package/dist/commonjs/utils/internal/optionallibs/reanimated.js.map +1 -0
  18. package/dist/commonjs/utils/push/android.js.map +1 -1
  19. package/dist/commonjs/utils/push/libs/callkeep.js +17 -0
  20. package/dist/commonjs/utils/push/libs/callkeep.js.map +1 -0
  21. package/dist/commonjs/utils/push/libs/expoNotifications.js +17 -0
  22. package/dist/commonjs/utils/push/libs/expoNotifications.js.map +1 -0
  23. package/dist/commonjs/utils/push/libs/expoTaskManager.js +17 -0
  24. package/dist/commonjs/utils/push/libs/expoTaskManager.js.map +1 -0
  25. package/dist/commonjs/utils/push/libs/firebaseMessaging.js +17 -0
  26. package/dist/commonjs/utils/push/libs/firebaseMessaging.js.map +1 -0
  27. package/dist/commonjs/utils/push/libs/index.js +72 -0
  28. package/dist/commonjs/utils/push/libs/index.js.map +1 -0
  29. package/dist/commonjs/utils/push/libs/iosPushNotification.js +17 -0
  30. package/dist/commonjs/utils/push/libs/iosPushNotification.js.map +1 -0
  31. package/dist/commonjs/utils/push/libs/voipPushNotification.js +17 -0
  32. package/dist/commonjs/utils/push/libs/voipPushNotification.js.map +1 -0
  33. package/dist/commonjs/utils/push/utils.js.map +1 -1
  34. package/dist/commonjs/utils/setClientDetails.js +3 -3
  35. package/dist/commonjs/utils/setClientDetails.js.map +1 -1
  36. package/dist/commonjs/version.js +1 -1
  37. package/dist/module/components/Call/CallControls/ScreenShareButton.js +3 -1
  38. package/dist/module/components/Call/CallControls/ScreenShareButton.js.map +1 -1
  39. package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
  40. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +1 -1
  41. package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
  42. package/dist/module/components/Participant/FloatingParticipantView/FloatingView/index.js +1 -1
  43. package/dist/module/hooks/internal/useCallMediaStreamCleanup.js +1 -1
  44. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  45. package/dist/module/utils/index.js.map +1 -1
  46. package/dist/module/utils/internal/optionallibs/gestureHandler.js +11 -0
  47. package/dist/module/utils/internal/optionallibs/gestureHandler.js.map +1 -0
  48. package/dist/module/utils/internal/optionallibs/index.js +3 -0
  49. package/dist/module/utils/internal/optionallibs/index.js.map +1 -0
  50. package/dist/module/utils/internal/optionallibs/reanimated.js +11 -0
  51. package/dist/module/utils/internal/optionallibs/reanimated.js.map +1 -0
  52. package/dist/module/utils/push/android.js.map +1 -1
  53. package/dist/module/utils/push/libs/callkeep.js +11 -0
  54. package/dist/module/utils/push/libs/callkeep.js.map +1 -0
  55. package/dist/module/utils/push/libs/expoNotifications.js +11 -0
  56. package/dist/module/utils/push/libs/expoNotifications.js.map +1 -0
  57. package/dist/module/utils/push/libs/expoTaskManager.js +11 -0
  58. package/dist/module/utils/push/libs/expoTaskManager.js.map +1 -0
  59. package/dist/module/utils/push/libs/firebaseMessaging.js +11 -0
  60. package/dist/module/utils/push/libs/firebaseMessaging.js.map +1 -0
  61. package/dist/module/utils/push/libs/index.js +12 -0
  62. package/dist/module/utils/push/libs/index.js.map +1 -0
  63. package/dist/module/utils/push/libs/iosPushNotification.js +11 -0
  64. package/dist/module/utils/push/libs/iosPushNotification.js.map +1 -0
  65. package/dist/module/utils/push/libs/voipPushNotification.js +11 -0
  66. package/dist/module/utils/push/libs/voipPushNotification.js.map +1 -0
  67. package/dist/module/utils/push/utils.js.map +1 -1
  68. package/dist/module/utils/setClientDetails.js +3 -3
  69. package/dist/module/utils/setClientDetails.js.map +1 -1
  70. package/dist/module/version.js +1 -1
  71. package/dist/typescript/components/Call/CallControls/ScreenShareButton.d.ts.map +1 -1
  72. package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
  73. package/dist/typescript/utils/index.d.ts.map +1 -1
  74. package/dist/typescript/utils/internal/optionallibs/gestureHandler.d.ts +3 -0
  75. package/dist/typescript/utils/internal/optionallibs/gestureHandler.d.ts.map +1 -0
  76. package/dist/typescript/utils/internal/optionallibs/index.d.ts +3 -0
  77. package/dist/typescript/utils/internal/optionallibs/index.d.ts.map +1 -0
  78. package/dist/typescript/utils/internal/optionallibs/reanimated.d.ts +4 -0
  79. package/dist/typescript/utils/internal/optionallibs/reanimated.d.ts.map +1 -0
  80. package/dist/typescript/utils/push/libs/callkeep.d.ts +4 -0
  81. package/dist/typescript/utils/push/libs/callkeep.d.ts.map +1 -0
  82. package/dist/typescript/utils/push/libs/expoNotifications.d.ts +3 -0
  83. package/dist/typescript/utils/push/libs/expoNotifications.d.ts.map +1 -0
  84. package/dist/typescript/utils/push/libs/expoTaskManager.d.ts +3 -0
  85. package/dist/typescript/utils/push/libs/expoTaskManager.d.ts.map +1 -0
  86. package/dist/typescript/utils/push/libs/firebaseMessaging.d.ts +4 -0
  87. package/dist/typescript/utils/push/libs/firebaseMessaging.d.ts.map +1 -0
  88. package/dist/typescript/utils/push/libs/index.d.ts +7 -0
  89. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -0
  90. package/dist/typescript/utils/push/libs/iosPushNotification.d.ts +3 -0
  91. package/dist/typescript/utils/push/libs/iosPushNotification.d.ts.map +1 -0
  92. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts +4 -0
  93. package/dist/typescript/utils/push/libs/voipPushNotification.d.ts.map +1 -0
  94. package/dist/typescript/version.d.ts +1 -1
  95. package/package.json +1 -1
  96. package/src/components/Call/CallControls/ScreenShareButton.tsx +1 -0
  97. package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +2 -1
  98. package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +2 -2
  99. package/src/components/Participant/FloatingParticipantView/FloatingView/index.ts +1 -1
  100. package/src/hooks/internal/useCallMediaStreamCleanup.ts +1 -1
  101. package/src/hooks/useAndroidKeepCallAliveEffect.ts +1 -1
  102. package/src/utils/index.ts +4 -2
  103. package/src/utils/internal/{optionalLibs.ts → optionallibs/gestureHandler.ts} +0 -13
  104. package/src/utils/internal/optionallibs/index.ts +2 -0
  105. package/src/utils/internal/optionallibs/reanimated.ts +14 -0
  106. package/src/utils/push/android.ts +6 -6
  107. package/src/utils/push/libs/callkeep.ts +16 -0
  108. package/src/utils/push/libs/expoNotifications.ts +16 -0
  109. package/src/utils/push/libs/expoTaskManager.ts +16 -0
  110. package/src/utils/push/libs/firebaseMessaging.ts +18 -0
  111. package/src/utils/push/libs/index.ts +11 -0
  112. package/src/utils/push/libs/iosPushNotification.ts +18 -0
  113. package/src/utils/push/libs/voipPushNotification.ts +17 -0
  114. package/src/utils/push/utils.ts +1 -1
  115. package/src/utils/setClientDetails.ts +3 -3
  116. package/src/version.ts +1 -1
  117. package/dist/commonjs/utils/internal/optionalLibs.js.map +0 -1
  118. package/dist/commonjs/utils/push/libs.js +0 -72
  119. package/dist/commonjs/utils/push/libs.js.map +0 -1
  120. package/dist/module/utils/internal/optionalLibs.js +0 -21
  121. package/dist/module/utils/internal/optionalLibs.js.map +0 -1
  122. package/dist/module/utils/push/libs.js +0 -61
  123. package/dist/module/utils/push/libs.js.map +0 -1
  124. package/dist/typescript/utils/internal/optionalLibs.d.ts +0 -6
  125. package/dist/typescript/utils/internal/optionalLibs.d.ts.map +0 -1
  126. package/dist/typescript/utils/push/libs.d.ts +0 -16
  127. package/dist/typescript/utils/push/libs.d.ts.map +0 -1
  128. package/src/utils/push/libs.ts +0 -96
@@ -0,0 +1,7 @@
1
+ export * from './expoNotifications';
2
+ export * from './expoTaskManager';
3
+ export * from './firebaseMessaging';
4
+ export * from './iosPushNotification';
5
+ export * from './voipPushNotification';
6
+ export * from './callkeep';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type PushNotificationIosLib = typeof import('@react-native-community/push-notification-ios').default;
2
+ export declare function getPushNotificationIosLib(): import("@react-native-community/push-notification-ios").PushNotificationIOSStatic;
3
+ //# sourceMappingURL=iosPushNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iosPushNotification.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/libs/iosPushNotification.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAChC,cAAc,+CAA+C,EAAE,OAAO,CAAC;AASzE,wBAAgB,yBAAyB,sFAOxC"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react-native-voip-push-notification" />
2
+ export type VoipPushNotificationType = typeof import('react-native-voip-push-notification').default;
3
+ export declare function getVoipPushNotificationLib(): typeof import("react-native-voip-push-notification").default;
4
+ //# sourceMappingURL=voipPushNotification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voipPushNotification.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/libs/voipPushNotification.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,wBAAwB,GAClC,cAAc,qCAAqC,EAAE,OAAO,CAAC;AAQ/D,wBAAgB,0BAA0B,iEAOzC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "0.5.6";
1
+ export declare const version = "0.5.8";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "module": "dist/module/index.js",
@@ -28,6 +28,7 @@ export type ScreenShareButtonProps = {
28
28
  // ios >= 14.0 or android
29
29
  const CanScreenShare =
30
30
  (Platform.OS === 'ios' &&
31
+ // @ts-ignore
31
32
  Number.parseInt(Platform.Version.split('.')[0], 10) >= 14) ||
32
33
  Platform.OS === 'android';
33
34
 
@@ -11,6 +11,7 @@ import { useTheme } from '../../../contexts/ThemeContext';
11
11
  import { CallContentProps } from '../CallContent';
12
12
  import { ParticipantViewComponentProps } from '../../Participant';
13
13
  import { useIsInPiPMode } from '../../../hooks';
14
+ import { StreamVideoParticipant } from '@stream-io/video-client';
14
15
 
15
16
  /**
16
17
  * Props for the CallParticipantsGrid component.
@@ -75,7 +76,7 @@ export const CallParticipantsGrid = ({
75
76
  if (isInPiPMode) {
76
77
  participants =
77
78
  remoteParticipants.length > 0
78
- ? [remoteParticipants[0]]
79
+ ? [remoteParticipants[0] as StreamVideoParticipant]
79
80
  : localParticipant
80
81
  ? [localParticipant]
81
82
  : [];
@@ -33,8 +33,8 @@ export type CallParticipantsSpotlightProps = ParticipantViewComponentProps &
33
33
  landscape?: boolean;
34
34
  };
35
35
 
36
- const hasScreenShare = (p: StreamVideoParticipant) =>
37
- p.publishedTracks.includes(SfuModels.TrackType.SCREEN_SHARE);
36
+ const hasScreenShare = (p: StreamVideoParticipant | undefined) =>
37
+ !!p?.publishedTracks.includes(SfuModels.TrackType.SCREEN_SHARE);
38
38
 
39
39
  /**
40
40
  * Component used to display the list of participants in a spotlight mode.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getGestureHandlerLib,
3
3
  getReanimatedLib,
4
- } from '../../../../utils/internal/optionalLibs';
4
+ } from '../../../../utils/internal/optionallibs';
5
5
  import { FloatingViewProps } from './common';
6
6
 
7
7
  const FloatingView: React.FC<FloatingViewProps> =
@@ -26,7 +26,7 @@ export const useCallMediaStreamCleanup = () => {
26
26
  )
27
27
  ) {
28
28
  // we cleanup media stream only if call is not joined or joining
29
- // @ts-expect-error Due to DOM typing incompatible with RN
29
+ // @ts-ignore Due to DOM typing incompatible with RN
30
30
  disposeOfMediaStream(mediaStream);
31
31
  }
32
32
  };
@@ -76,7 +76,7 @@ export const useAndroidKeepCallAliveEffect = () => {
76
76
  const { useCallCallingState } = useCallStateHooks();
77
77
  const callingState = useCallCallingState();
78
78
 
79
- useEffect(() => {
79
+ useEffect((): (() => void) | undefined => {
80
80
  if (Platform.OS !== 'android') {
81
81
  return;
82
82
  }
@@ -29,9 +29,11 @@ export const generateParticipantTitle = (memberUserId: string) => {
29
29
  // Utility to get initials of a name
30
30
  export const getInitialsOfName = (name: string) => {
31
31
  const names = name.split(' ');
32
- let initials = names[0].substring(0, 1).toUpperCase();
32
+ let initials = (names[0] as string).substring(0, 1).toUpperCase();
33
33
  if (names.length > 1) {
34
- initials += names[names.length - 1].substring(0, 1).toUpperCase();
34
+ initials += (names[names.length - 1] as string)
35
+ .substring(0, 1)
36
+ .toUpperCase();
35
37
  }
36
38
  return initials;
37
39
  };
@@ -1,24 +1,11 @@
1
1
  export type GestureHandlerType = typeof import('react-native-gesture-handler');
2
- export type ReanimatedType = typeof import('react-native-reanimated');
3
2
 
4
3
  let gestureHandler: GestureHandlerType | undefined;
5
- let reanimated: ReanimatedType | undefined;
6
4
 
7
5
  try {
8
6
  gestureHandler = require('react-native-gesture-handler');
9
7
  } catch (e) {}
10
8
 
11
- try {
12
- reanimated = require('react-native-reanimated');
13
- } catch (e) {}
14
-
15
- export const getReanimatedLib = (onPackageNotFound = () => {}) => {
16
- if (!reanimated) {
17
- onPackageNotFound();
18
- }
19
- return reanimated;
20
- };
21
-
22
9
  export const getGestureHandlerLib = (onPackageNotFound = () => {}) => {
23
10
  if (!gestureHandler) {
24
11
  onPackageNotFound();
@@ -0,0 +1,2 @@
1
+ export * from './gestureHandler';
2
+ export * from './reanimated';
@@ -0,0 +1,14 @@
1
+ export type ReanimatedType = typeof import('react-native-reanimated');
2
+
3
+ let reanimated: ReanimatedType | undefined;
4
+
5
+ try {
6
+ reanimated = require('react-native-reanimated');
7
+ } catch (e) {}
8
+
9
+ export const getReanimatedLib = (onPackageNotFound = () => {}) => {
10
+ if (!reanimated) {
11
+ onPackageNotFound();
12
+ }
13
+ return reanimated;
14
+ };
@@ -159,9 +159,9 @@ const firebaseMessagingOnMessageHandler = async (
159
159
  }
160
160
 
161
161
  if (data.type === 'call.ring') {
162
- const call_cid = data.call_cid;
163
- const created_by_id = data.created_by_id;
164
- const receiver_id = data.receiver_id;
162
+ const call_cid = data.call_cid as string;
163
+ const created_by_id = data.created_by_id as string;
164
+ const receiver_id = data.receiver_id as string;
165
165
 
166
166
  function shouldCallBeClosed(callToCheck: Call) {
167
167
  const { mustEndCall } = shouldCallBeEnded(
@@ -222,7 +222,7 @@ const firebaseMessagingOnMessageHandler = async (
222
222
  }
223
223
  await notifee.createChannel(incomingCallChannel);
224
224
  const { getTitle, getBody } = incomingCallNotificationTextGetters;
225
- const createdUserName = data.created_by_display_name;
225
+ const createdUserName = data.created_by_display_name as string;
226
226
 
227
227
  const channelId = incomingCallChannel.id;
228
228
  await notifee.displayNotification({
@@ -288,7 +288,7 @@ const firebaseMessagingOnMessageHandler = async (
288
288
  await notifee.createChannel(callChannel);
289
289
  const channelId = callChannel.id;
290
290
  const { getTitle, getBody } = callNotificationTextGetters;
291
- const createdUserName = data.created_by_display_name;
291
+ const createdUserName = data.created_by_display_name as string;
292
292
  // we can safely cast to string because the data is from "stream.video"
293
293
  const type = data.type as NonRingingPushEvent;
294
294
  await notifee.displayNotification({
@@ -306,7 +306,7 @@ const firebaseMessagingOnMessageHandler = async (
306
306
  timeoutAfter: 60000, // 60 seconds, after which the notification will be dismissed automatically
307
307
  },
308
308
  });
309
- const cid = data.call_cid;
309
+ const cid = data.call_cid as string;
310
310
  pushNonRingingCallData$.next({ cid, type });
311
311
  }
312
312
  };
@@ -0,0 +1,16 @@
1
+ export type RNCallKeepType = typeof import('react-native-callkeep').default;
2
+
3
+ let callkeep: RNCallKeepType | undefined;
4
+
5
+ try {
6
+ callkeep = require('react-native-callkeep').default;
7
+ } catch (_e) {}
8
+
9
+ export function getCallKeepLib() {
10
+ if (!callkeep) {
11
+ throw Error(
12
+ 'react-native-callkeep library is not installed. Please see https://github.com/react-native-webrtc/react-native-callkeep#Installation for installation instructions',
13
+ );
14
+ }
15
+ return callkeep;
16
+ }
@@ -0,0 +1,16 @@
1
+ export type ExpoNotificationsLib = typeof import('expo-notifications');
2
+
3
+ let expoNotificationsLib: ExpoNotificationsLib | undefined;
4
+
5
+ try {
6
+ expoNotificationsLib = require('expo-notifications');
7
+ } catch (_e) {}
8
+
9
+ export function getExpoNotificationsLib() {
10
+ if (!expoNotificationsLib) {
11
+ throw Error(
12
+ 'expo-notifications library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/notifications/ for installation instructions',
13
+ );
14
+ }
15
+ return expoNotificationsLib;
16
+ }
@@ -0,0 +1,16 @@
1
+ export type ExpoTaskManagerLib = typeof import('expo-task-manager');
2
+
3
+ let expoTaskManagerLib: ExpoTaskManagerLib | undefined;
4
+
5
+ try {
6
+ expoTaskManagerLib = require('expo-task-manager');
7
+ } catch (_e) {}
8
+
9
+ export function getExpoTaskManagerLib(): ExpoTaskManagerLib {
10
+ if (!expoTaskManagerLib) {
11
+ throw Error(
12
+ 'expo-task-manager library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/task-manager/ for installation instructions',
13
+ );
14
+ }
15
+ return expoTaskManagerLib;
16
+ }
@@ -0,0 +1,18 @@
1
+ export type { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
2
+ export type FirebaseMessagingType =
3
+ typeof import('@react-native-firebase/messaging').default;
4
+
5
+ let messaging: FirebaseMessagingType | undefined;
6
+
7
+ try {
8
+ messaging = require('@react-native-firebase/messaging').default;
9
+ } catch (_e) {}
10
+
11
+ export function getFirebaseMessagingLib() {
12
+ if (!messaging) {
13
+ throw Error(
14
+ 'react-native-firebase library is not installed. Please see https://rnfirebase.io/messaging/usage#installation for installation instructions',
15
+ );
16
+ }
17
+ return messaging;
18
+ }
@@ -0,0 +1,11 @@
1
+ export * from './expoNotifications';
2
+ export * from './expoTaskManager';
3
+ export * from './firebaseMessaging';
4
+ export * from './iosPushNotification';
5
+ export * from './voipPushNotification';
6
+ export * from './callkeep';
7
+
8
+ /*
9
+ NOTE: must keep each libs in different files
10
+ Else on commonjs, metro doesnt resolve modules properly if one of the module is not installed
11
+ */
@@ -0,0 +1,18 @@
1
+ export type PushNotificationIosLib =
2
+ typeof import('@react-native-community/push-notification-ios').default;
3
+
4
+ let pushNotificationIosLib: PushNotificationIosLib | undefined;
5
+
6
+ try {
7
+ pushNotificationIosLib =
8
+ require('@react-native-community/push-notification-ios').default;
9
+ } catch (_e) {}
10
+
11
+ export function getPushNotificationIosLib() {
12
+ if (!pushNotificationIosLib) {
13
+ throw Error(
14
+ '@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"',
15
+ );
16
+ }
17
+ return pushNotificationIosLib;
18
+ }
@@ -0,0 +1,17 @@
1
+ export type VoipPushNotificationType =
2
+ typeof import('react-native-voip-push-notification').default;
3
+
4
+ let voipPushNotification: VoipPushNotificationType | undefined;
5
+
6
+ try {
7
+ voipPushNotification = require('react-native-voip-push-notification').default;
8
+ } catch (_e) {}
9
+
10
+ export function getVoipPushNotificationLib() {
11
+ if (!voipPushNotification) {
12
+ throw Error(
13
+ "react-native-voip-push-notification library is not installed. Please install it using 'yarn add react-native-voip-push-notification' or 'npm i react-native-voip-push-notification --save'",
14
+ );
15
+ }
16
+ return voipPushNotification;
17
+ }
@@ -128,7 +128,7 @@ export const processNonIncomingCallFromPush = async (
128
128
  } else {
129
129
  // if not it means that WS is not alive when receiving the push notifications and we need to fetch the call
130
130
  const [callType, callId] = call_cid.split(':');
131
- callFromPush = client.call(callType, callId);
131
+ callFromPush = client.call(callType as string, callId as string);
132
132
  await callFromPush.get();
133
133
  }
134
134
  } catch (e) {
@@ -12,9 +12,9 @@ const [major, minor, patch] = version.split('.');
12
12
  export const setClientDetails = () => {
13
13
  setSdkInfo({
14
14
  type: SfuModels.SdkType.REACT_NATIVE,
15
- major,
16
- minor,
17
- patch,
15
+ major: major as string,
16
+ minor: minor as string,
17
+ patch: patch as string,
18
18
  });
19
19
 
20
20
  let osName: string = Platform.OS;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '0.5.6';
1
+ export const version = '0.5.8';
@@ -1 +0,0 @@
1
- {"version":3,"names":["gestureHandler","reanimated","require","e","getReanimatedLib","onPackageNotFound","exports","getGestureHandlerLib"],"sourceRoot":"../../../../src","sources":["utils/internal/optionalLibs.ts"],"mappings":";;;;;;AAGA,IAAIA,cAA8C;AAClD,IAAIC,UAAsC;AAE1C,IAAI;EACFD,cAAc,GAAGE,OAAO,CAAC,8BAA8B,CAAC;AAC1D,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,IAAI;EACFF,UAAU,GAAGC,OAAO,CAAC,yBAAyB,CAAC;AACjD,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEN,MAAMC,gBAAgB,GAAGA,CAACC,iBAAiB,GAAGA,CAAA,KAAM,CAAC,CAAC,KAAK;EAChE,IAAI,CAACJ,UAAU,EAAE;IACfI,iBAAiB,CAAC,CAAC;EACrB;EACA,OAAOJ,UAAU;AACnB,CAAC;AAACK,OAAA,CAAAF,gBAAA,GAAAA,gBAAA;AAEK,MAAMG,oBAAoB,GAAGA,CAACF,iBAAiB,GAAGA,CAAA,KAAM,CAAC,CAAC,KAAK;EACpE,IAAI,CAACL,cAAc,EAAE;IACnBK,iBAAiB,CAAC,CAAC;EACrB;EACA,OAAOL,cAAc;AACvB,CAAC;AAACM,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
@@ -1,72 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getCallKeepLib = getCallKeepLib;
7
- exports.getExpoNotificationsLib = getExpoNotificationsLib;
8
- exports.getExpoTaskManagerLib = getExpoTaskManagerLib;
9
- exports.getFirebaseMessagingLib = getFirebaseMessagingLib;
10
- exports.getPushNotificationIosLib = getPushNotificationIosLib;
11
- exports.getVoipPushNotificationLib = getVoipPushNotificationLib;
12
- let callkeep;
13
- let messaging;
14
- let voipPushNotification;
15
- let expoNotificationsLib;
16
- let expoTaskManagerLib;
17
- let pushNotificationIosLib;
18
- try {
19
- callkeep = require('react-native-callkeep').default;
20
- } catch (e) {}
21
- try {
22
- messaging = require('@react-native-firebase/messaging').default;
23
- } catch (e) {}
24
- try {
25
- voipPushNotification = require('react-native-voip-push-notification').default;
26
- } catch (e) {}
27
- try {
28
- expoNotificationsLib = require('expo-notifications');
29
- } catch (e) {}
30
- try {
31
- expoTaskManagerLib = require('expo-task-manager');
32
- } catch (e) {}
33
- try {
34
- pushNotificationIosLib = require('@react-native-community/push-notification-ios').default;
35
- } catch (e) {}
36
- function getExpoNotificationsLib() {
37
- if (!expoNotificationsLib) {
38
- throw Error('expo-notifications library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/notifications/ for installation instructions');
39
- }
40
- return expoNotificationsLib;
41
- }
42
- function getExpoTaskManagerLib() {
43
- if (!expoTaskManagerLib) {
44
- throw Error('expo-task-manager library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/task-manager/ for installation instructions');
45
- }
46
- return expoTaskManagerLib;
47
- }
48
- function getPushNotificationIosLib() {
49
- if (!pushNotificationIosLib) {
50
- 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"');
51
- }
52
- return pushNotificationIosLib;
53
- }
54
- function getCallKeepLib() {
55
- if (!callkeep) {
56
- throw Error('react-native-callkeep library is not installed. Please see https://github.com/react-native-webrtc/react-native-callkeep#Installation for installation instructions');
57
- }
58
- return callkeep;
59
- }
60
- function getFirebaseMessagingLib() {
61
- if (!messaging) {
62
- throw Error('react-native-firebase library is not installed. Please see https://rnfirebase.io/messaging/usage#installation for installation instructions');
63
- }
64
- return messaging;
65
- }
66
- function getVoipPushNotificationLib() {
67
- if (!voipPushNotification) {
68
- throw Error("react-native-voip-push-notification library is not installed. Please install it using 'yarn add react-native-voip-push-notification' or 'npm i react-native-voip-push-notification --save'");
69
- }
70
- return voipPushNotification;
71
- }
72
- //# sourceMappingURL=libs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["callkeep","messaging","voipPushNotification","expoNotificationsLib","expoTaskManagerLib","pushNotificationIosLib","require","default","e","getExpoNotificationsLib","Error","getExpoTaskManagerLib","getPushNotificationIosLib","getCallKeepLib","getFirebaseMessagingLib","getVoipPushNotificationLib"],"sourceRoot":"../../../../src","sources":["utils/push/libs.ts"],"mappings":";;;;;;;;;;;AAWA,IAAIA,QAAoC;AACxC,IAAIC,SAA4C;AAChD,IAAIC,oBAA0D;AAC9D,IAAIC,oBAAsD;AAC1D,IAAIC,kBAAkD;AACtD,IAAIC,sBAA0D;AAE9D,IAAI;EACFL,QAAQ,GAAGM,OAAO,CAAC,uBAAuB,CAAC,CAACC,OAAO;AACrD,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,IAAI;EACFP,SAAS,GAAGK,OAAO,CAAC,kCAAkC,CAAC,CAACC,OAAO;AACjE,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,IAAI;EACFN,oBAAoB,GAAGI,OAAO,CAAC,qCAAqC,CAAC,CAACC,OAAO;AAC/E,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,IAAI;EACFL,oBAAoB,GAAGG,OAAO,CAAC,oBAAoB,CAAC;AACtD,CAAC,CAAC,OAAOE,CAAC,EAAE,CAAC;AAEb,IAAI;EACFJ,kBAAkB,GAAGE,OAAO,CAAC,mBAAmB,CAAC;AACnD,CAAC,CAAC,OAAOE,CAAC,EAAE,CAAC;AAEb,IAAI;EACFH,sBAAsB,GACpBC,OAAO,CAAC,+CAA+C,CAAC,CAACC,OAAO;AACpE,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEN,SAASC,uBAAuBA,CAAA,EAAG;EACxC,IAAI,CAACN,oBAAoB,EAAE;IACzB,MAAMO,KAAK,CACT,gJACF,CAAC;EACH;EACA,OAAOP,oBAAoB;AAC7B;AAEO,SAASQ,qBAAqBA,CAAA,EAAG;EACtC,IAAI,CAACP,kBAAkB,EAAE;IACvB,MAAMM,KAAK,CACT,8IACF,CAAC;EACH;EACA,OAAON,kBAAkB;AAC3B;AAEO,SAASQ,yBAAyBA,CAAA,EAAG;EAC1C,IAAI,CAACP,sBAAsB,EAAE;IAC3B,MAAMK,KAAK,CACT,0NACF,CAAC;EACH;EACA,OAAOL,sBAAsB;AAC/B;AAEO,SAASQ,cAAcA,CAAA,EAAG;EAC/B,IAAI,CAACb,QAAQ,EAAE;IACb,MAAMU,KAAK,CACT,oKACF,CAAC;EACH;EACA,OAAOV,QAAQ;AACjB;AAEO,SAASc,uBAAuBA,CAAA,EAAG;EACxC,IAAI,CAACb,SAAS,EAAE;IACd,MAAMS,KAAK,CACT,6IACF,CAAC;EACH;EACA,OAAOT,SAAS;AAClB;AAEO,SAASc,0BAA0BA,CAAA,EAAG;EAC3C,IAAI,CAACb,oBAAoB,EAAE;IACzB,MAAMQ,KAAK,CACT,4LACF,CAAC;EACH;EACA,OAAOR,oBAAoB;AAC7B"}
@@ -1,21 +0,0 @@
1
- let gestureHandler;
2
- let reanimated;
3
- try {
4
- gestureHandler = require('react-native-gesture-handler');
5
- } catch (e) {}
6
- try {
7
- reanimated = require('react-native-reanimated');
8
- } catch (e) {}
9
- export const getReanimatedLib = (onPackageNotFound = () => {}) => {
10
- if (!reanimated) {
11
- onPackageNotFound();
12
- }
13
- return reanimated;
14
- };
15
- export const getGestureHandlerLib = (onPackageNotFound = () => {}) => {
16
- if (!gestureHandler) {
17
- onPackageNotFound();
18
- }
19
- return gestureHandler;
20
- };
21
- //# sourceMappingURL=optionalLibs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["gestureHandler","reanimated","require","e","getReanimatedLib","onPackageNotFound","getGestureHandlerLib"],"sourceRoot":"../../../../src","sources":["utils/internal/optionalLibs.ts"],"mappings":"AAGA,IAAIA,cAA8C;AAClD,IAAIC,UAAsC;AAE1C,IAAI;EACFD,cAAc,GAAGE,OAAO,CAAC,8BAA8B,CAAC;AAC1D,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,IAAI;EACFF,UAAU,GAAGC,OAAO,CAAC,yBAAyB,CAAC;AACjD,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,OAAO,MAAMC,gBAAgB,GAAGA,CAACC,iBAAiB,GAAGA,CAAA,KAAM,CAAC,CAAC,KAAK;EAChE,IAAI,CAACJ,UAAU,EAAE;IACfI,iBAAiB,CAAC,CAAC;EACrB;EACA,OAAOJ,UAAU;AACnB,CAAC;AAED,OAAO,MAAMK,oBAAoB,GAAGA,CAACD,iBAAiB,GAAGA,CAAA,KAAM,CAAC,CAAC,KAAK;EACpE,IAAI,CAACL,cAAc,EAAE;IACnBK,iBAAiB,CAAC,CAAC;EACrB;EACA,OAAOL,cAAc;AACvB,CAAC"}
@@ -1,61 +0,0 @@
1
- let callkeep;
2
- let messaging;
3
- let voipPushNotification;
4
- let expoNotificationsLib;
5
- let expoTaskManagerLib;
6
- let pushNotificationIosLib;
7
- try {
8
- callkeep = require('react-native-callkeep').default;
9
- } catch (e) {}
10
- try {
11
- messaging = require('@react-native-firebase/messaging').default;
12
- } catch (e) {}
13
- try {
14
- voipPushNotification = require('react-native-voip-push-notification').default;
15
- } catch (e) {}
16
- try {
17
- expoNotificationsLib = require('expo-notifications');
18
- } catch (e) {}
19
- try {
20
- expoTaskManagerLib = require('expo-task-manager');
21
- } catch (e) {}
22
- try {
23
- pushNotificationIosLib = require('@react-native-community/push-notification-ios').default;
24
- } catch (e) {}
25
- export function getExpoNotificationsLib() {
26
- if (!expoNotificationsLib) {
27
- throw Error('expo-notifications library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/notifications/ for installation instructions');
28
- }
29
- return expoNotificationsLib;
30
- }
31
- export function getExpoTaskManagerLib() {
32
- if (!expoTaskManagerLib) {
33
- throw Error('expo-task-manager library is not installed. Please see https://docs.expo.dev/versions/latest/sdk/task-manager/ for installation instructions');
34
- }
35
- return expoTaskManagerLib;
36
- }
37
- export function getPushNotificationIosLib() {
38
- if (!pushNotificationIosLib) {
39
- 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"');
40
- }
41
- return pushNotificationIosLib;
42
- }
43
- export function getCallKeepLib() {
44
- if (!callkeep) {
45
- throw Error('react-native-callkeep library is not installed. Please see https://github.com/react-native-webrtc/react-native-callkeep#Installation for installation instructions');
46
- }
47
- return callkeep;
48
- }
49
- export function getFirebaseMessagingLib() {
50
- if (!messaging) {
51
- throw Error('react-native-firebase library is not installed. Please see https://rnfirebase.io/messaging/usage#installation for installation instructions');
52
- }
53
- return messaging;
54
- }
55
- export function getVoipPushNotificationLib() {
56
- if (!voipPushNotification) {
57
- throw Error("react-native-voip-push-notification library is not installed. Please install it using 'yarn add react-native-voip-push-notification' or 'npm i react-native-voip-push-notification --save'");
58
- }
59
- return voipPushNotification;
60
- }
61
- //# sourceMappingURL=libs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["callkeep","messaging","voipPushNotification","expoNotificationsLib","expoTaskManagerLib","pushNotificationIosLib","require","default","e","getExpoNotificationsLib","Error","getExpoTaskManagerLib","getPushNotificationIosLib","getCallKeepLib","getFirebaseMessagingLib","getVoipPushNotificationLib"],"sourceRoot":"../../../../src","sources":["utils/push/libs.ts"],"mappings":"AAWA,IAAIA,QAAoC;AACxC,IAAIC,SAA4C;AAChD,IAAIC,oBAA0D;AAC9D,IAAIC,oBAAsD;AAC1D,IAAIC,kBAAkD;AACtD,IAAIC,sBAA0D;AAE9D,IAAI;EACFL,QAAQ,GAAGM,OAAO,CAAC,uBAAuB,CAAC,CAACC,OAAO;AACrD,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,IAAI;EACFP,SAAS,GAAGK,OAAO,CAAC,kCAAkC,CAAC,CAACC,OAAO;AACjE,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,IAAI;EACFN,oBAAoB,GAAGI,OAAO,CAAC,qCAAqC,CAAC,CAACC,OAAO;AAC/E,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,IAAI;EACFL,oBAAoB,GAAGG,OAAO,CAAC,oBAAoB,CAAC;AACtD,CAAC,CAAC,OAAOE,CAAC,EAAE,CAAC;AAEb,IAAI;EACFJ,kBAAkB,GAAGE,OAAO,CAAC,mBAAmB,CAAC;AACnD,CAAC,CAAC,OAAOE,CAAC,EAAE,CAAC;AAEb,IAAI;EACFH,sBAAsB,GACpBC,OAAO,CAAC,+CAA+C,CAAC,CAACC,OAAO;AACpE,CAAC,CAAC,OAAOC,CAAC,EAAE,CAAC;AAEb,OAAO,SAASC,uBAAuBA,CAAA,EAAG;EACxC,IAAI,CAACN,oBAAoB,EAAE;IACzB,MAAMO,KAAK,CACT,gJACF,CAAC;EACH;EACA,OAAOP,oBAAoB;AAC7B;AAEA,OAAO,SAASQ,qBAAqBA,CAAA,EAAG;EACtC,IAAI,CAACP,kBAAkB,EAAE;IACvB,MAAMM,KAAK,CACT,8IACF,CAAC;EACH;EACA,OAAON,kBAAkB;AAC3B;AAEA,OAAO,SAASQ,yBAAyBA,CAAA,EAAG;EAC1C,IAAI,CAACP,sBAAsB,EAAE;IAC3B,MAAMK,KAAK,CACT,0NACF,CAAC;EACH;EACA,OAAOL,sBAAsB;AAC/B;AAEA,OAAO,SAASQ,cAAcA,CAAA,EAAG;EAC/B,IAAI,CAACb,QAAQ,EAAE;IACb,MAAMU,KAAK,CACT,oKACF,CAAC;EACH;EACA,OAAOV,QAAQ;AACjB;AAEA,OAAO,SAASc,uBAAuBA,CAAA,EAAG;EACxC,IAAI,CAACb,SAAS,EAAE;IACd,MAAMS,KAAK,CACT,6IACF,CAAC;EACH;EACA,OAAOT,SAAS;AAClB;AAEA,OAAO,SAASc,0BAA0BA,CAAA,EAAG;EAC3C,IAAI,CAACb,oBAAoB,EAAE;IACzB,MAAMQ,KAAK,CACT,4LACF,CAAC;EACH;EACA,OAAOR,oBAAoB;AAC7B"}
@@ -1,6 +0,0 @@
1
- /// <reference types="react-native-reanimated" />
2
- export type GestureHandlerType = typeof import('react-native-gesture-handler');
3
- export type ReanimatedType = typeof import('react-native-reanimated');
4
- export declare const getReanimatedLib: (onPackageNotFound?: () => void) => typeof import("react-native-reanimated") | undefined;
5
- export declare const getGestureHandlerLib: (onPackageNotFound?: () => void) => typeof import("react-native-gesture-handler") | undefined;
6
- //# sourceMappingURL=optionalLibs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optionalLibs.d.ts","sourceRoot":"","sources":["../../../../src/utils/internal/optionalLibs.ts"],"names":[],"mappings":";AAAA,MAAM,MAAM,kBAAkB,GAAG,cAAc,8BAA8B,CAAC,CAAC;AAC/E,MAAM,MAAM,cAAc,GAAG,cAAc,yBAAyB,CAAC,CAAC;AAatE,eAAO,MAAM,gBAAgB,0FAK5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,+FAKhC,CAAC"}
@@ -1,16 +0,0 @@
1
- /// <reference types="react-native-callkeep" />
2
- /// <reference types="react-native-voip-push-notification" />
3
- export type { FirebaseMessagingTypes } from '@react-native-firebase/messaging';
4
- export type RNCallKeepType = typeof import('react-native-callkeep').default;
5
- export type FirebaseMessagingType = typeof import('@react-native-firebase/messaging').default;
6
- export type VoipPushNotificationType = typeof import('react-native-voip-push-notification').default;
7
- export type ExpoNotificationsLib = typeof import('expo-notifications');
8
- export type ExpoTaskManagerLib = typeof import('expo-task-manager');
9
- export type PushNotificationIosLib = typeof import('@react-native-community/push-notification-ios').default;
10
- export declare function getExpoNotificationsLib(): typeof import("expo-notifications");
11
- export declare function getExpoTaskManagerLib(): typeof import("expo-task-manager");
12
- export declare function getPushNotificationIosLib(): import("@react-native-community/push-notification-ios").PushNotificationIOSStatic;
13
- export declare function getCallKeepLib(): typeof import("react-native-callkeep").default;
14
- export declare function getFirebaseMessagingLib(): import("@react-native-firebase/app").ReactNativeFirebase.FirebaseModuleWithStatics<import("@react-native-firebase/messaging").FirebaseMessagingTypes.Module, import("@react-native-firebase/messaging").FirebaseMessagingTypes.Statics>;
15
- export declare function getVoipPushNotificationLib(): typeof import("react-native-voip-push-notification").default;
16
- //# sourceMappingURL=libs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"libs.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/libs.ts"],"names":[],"mappings":";;AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/E,MAAM,MAAM,cAAc,GAAG,cAAc,uBAAuB,EAAE,OAAO,CAAC;AAC5E,MAAM,MAAM,qBAAqB,GAC/B,cAAc,kCAAkC,EAAE,OAAO,CAAC;AAC5D,MAAM,MAAM,wBAAwB,GAClC,cAAc,qCAAqC,EAAE,OAAO,CAAC;AAC/D,MAAM,MAAM,oBAAoB,GAAG,cAAc,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,cAAc,mBAAmB,CAAC,CAAC;AACpE,MAAM,MAAM,sBAAsB,GAChC,cAAc,+CAA+C,EAAE,OAAO,CAAC;AAkCzE,wBAAgB,uBAAuB,wCAOtC;AAED,wBAAgB,qBAAqB,uCAOpC;AAED,wBAAgB,yBAAyB,sFAOxC;AAED,wBAAgB,cAAc,mDAO7B;AAED,wBAAgB,uBAAuB,4OAOtC;AAED,wBAAgB,0BAA0B,iEAOzC"}