@stream-io/video-react-native-sdk 1.2.14 → 1.3.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 (127) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/commonjs/hooks/push/useIosCallKeepEventsSetupEffect.js +43 -6
  3. package/dist/commonjs/hooks/push/useIosCallKeepEventsSetupEffect.js.map +1 -1
  4. package/dist/commonjs/hooks/push/useIosCallkeepWithCallingStateEffect.js +1 -1
  5. package/dist/commonjs/hooks/push/useIosVoipPushEventsSetupEffect.js +2 -2
  6. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js +2 -7
  7. package/dist/commonjs/hooks/push/useProcessPushCallEffect.js.map +1 -1
  8. package/dist/commonjs/hooks/push/useProcessPushNonRingingCallEffect.js +3 -3
  9. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +1 -0
  10. package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  11. package/dist/commonjs/providers/StreamCall.js +1 -1
  12. package/dist/commonjs/utils/StreamVideoRN/index.js +5 -6
  13. package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
  14. package/dist/commonjs/utils/index.js +12 -0
  15. package/dist/commonjs/utils/index.js.map +1 -1
  16. package/dist/commonjs/utils/push/android.js +23 -79
  17. package/dist/commonjs/utils/push/android.js.map +1 -1
  18. package/dist/commonjs/utils/push/index.js +39 -0
  19. package/dist/commonjs/utils/push/index.js.map +1 -0
  20. package/dist/commonjs/utils/push/internal/rxSubjects.js.map +1 -0
  21. package/dist/commonjs/utils/push/internal/utils.js +157 -0
  22. package/dist/commonjs/utils/push/internal/utils.js.map +1 -0
  23. package/dist/commonjs/utils/push/ios.js +43 -84
  24. package/dist/commonjs/utils/push/ios.js.map +1 -1
  25. package/dist/commonjs/utils/push/libs/expoNotifications.js.map +1 -1
  26. package/dist/commonjs/utils/push/libs/index.js +0 -11
  27. package/dist/commonjs/utils/push/libs/index.js.map +1 -1
  28. package/dist/commonjs/utils/push/libs/iosPushNotification.js.map +1 -1
  29. package/dist/commonjs/utils/push/utils.js +29 -150
  30. package/dist/commonjs/utils/push/utils.js.map +1 -1
  31. package/dist/commonjs/version.js +1 -1
  32. package/dist/commonjs/version.js.map +1 -1
  33. package/dist/module/hooks/push/useIosCallKeepEventsSetupEffect.js +41 -4
  34. package/dist/module/hooks/push/useIosCallKeepEventsSetupEffect.js.map +1 -1
  35. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js +1 -1
  36. package/dist/module/hooks/push/useIosCallkeepWithCallingStateEffect.js.map +1 -1
  37. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js +2 -2
  38. package/dist/module/hooks/push/useIosVoipPushEventsSetupEffect.js.map +1 -1
  39. package/dist/module/hooks/push/useProcessPushCallEffect.js +2 -7
  40. package/dist/module/hooks/push/useProcessPushCallEffect.js.map +1 -1
  41. package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js +3 -3
  42. package/dist/module/hooks/push/useProcessPushNonRingingCallEffect.js.map +1 -1
  43. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +1 -0
  44. package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
  45. package/dist/module/providers/StreamCall.js +1 -1
  46. package/dist/module/providers/StreamCall.js.map +1 -1
  47. package/dist/module/utils/StreamVideoRN/index.js +5 -6
  48. package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
  49. package/dist/module/utils/index.js +1 -0
  50. package/dist/module/utils/index.js.map +1 -1
  51. package/dist/module/utils/push/android.js +20 -79
  52. package/dist/module/utils/push/android.js.map +1 -1
  53. package/dist/module/utils/push/index.js +4 -0
  54. package/dist/module/utils/push/index.js.map +1 -0
  55. package/dist/module/utils/push/internal/rxSubjects.js.map +1 -0
  56. package/dist/module/utils/push/internal/utils.js +146 -0
  57. package/dist/module/utils/push/internal/utils.js.map +1 -0
  58. package/dist/module/utils/push/ios.js +40 -81
  59. package/dist/module/utils/push/ios.js.map +1 -1
  60. package/dist/module/utils/push/libs/expoNotifications.js.map +1 -1
  61. package/dist/module/utils/push/libs/index.js +0 -1
  62. package/dist/module/utils/push/libs/index.js.map +1 -1
  63. package/dist/module/utils/push/libs/iosPushNotification.js.map +1 -1
  64. package/dist/module/utils/push/utils.js +25 -144
  65. package/dist/module/utils/push/utils.js.map +1 -1
  66. package/dist/module/version.js +1 -1
  67. package/dist/module/version.js.map +1 -1
  68. package/dist/typescript/hooks/push/useIosCallKeepEventsSetupEffect.d.ts.map +1 -1
  69. package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
  70. package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
  71. package/dist/typescript/utils/StreamVideoRN/types.d.ts +6 -4
  72. package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
  73. package/dist/typescript/utils/index.d.ts +1 -0
  74. package/dist/typescript/utils/index.d.ts.map +1 -1
  75. package/dist/typescript/utils/push/android.d.ts +12 -2
  76. package/dist/typescript/utils/push/android.d.ts.map +1 -1
  77. package/dist/typescript/utils/push/index.d.ts +4 -0
  78. package/dist/typescript/utils/push/index.d.ts.map +1 -0
  79. package/dist/typescript/utils/push/{rxSubjects.d.ts → internal/rxSubjects.d.ts} +1 -1
  80. package/dist/typescript/utils/push/internal/rxSubjects.d.ts.map +1 -0
  81. package/dist/typescript/utils/push/internal/utils.d.ts +43 -0
  82. package/dist/typescript/utils/push/internal/utils.d.ts.map +1 -0
  83. package/dist/typescript/utils/push/ios.d.ts +8 -3
  84. package/dist/typescript/utils/push/ios.d.ts.map +1 -1
  85. package/dist/typescript/utils/push/libs/expoNotifications.d.ts +2 -0
  86. package/dist/typescript/utils/push/libs/expoNotifications.d.ts.map +1 -1
  87. package/dist/typescript/utils/push/libs/index.d.ts +0 -1
  88. package/dist/typescript/utils/push/libs/index.d.ts.map +1 -1
  89. package/dist/typescript/utils/push/libs/iosPushNotification.d.ts +2 -0
  90. package/dist/typescript/utils/push/libs/iosPushNotification.d.ts.map +1 -1
  91. package/dist/typescript/utils/push/utils.d.ts +14 -42
  92. package/dist/typescript/utils/push/utils.d.ts.map +1 -1
  93. package/dist/typescript/version.d.ts +1 -1
  94. package/dist/typescript/version.d.ts.map +1 -1
  95. package/package.json +6 -11
  96. package/src/hooks/push/useIosCallKeepEventsSetupEffect.ts +62 -6
  97. package/src/hooks/push/useIosCallkeepWithCallingStateEffect.ts +1 -1
  98. package/src/hooks/push/useIosVoipPushEventsSetupEffect.ts +2 -2
  99. package/src/hooks/push/useProcessPushCallEffect.ts +2 -7
  100. package/src/hooks/push/useProcessPushNonRingingCallEffect.ts +3 -3
  101. package/src/hooks/useAndroidKeepCallAliveEffect.ts +1 -0
  102. package/src/providers/StreamCall.tsx +1 -1
  103. package/src/utils/StreamVideoRN/index.ts +11 -6
  104. package/src/utils/StreamVideoRN/types.ts +6 -4
  105. package/src/utils/index.ts +1 -0
  106. package/src/utils/push/android.ts +28 -99
  107. package/src/utils/push/index.ts +3 -0
  108. package/src/utils/push/{rxSubjects.ts → internal/rxSubjects.ts} +1 -1
  109. package/src/utils/push/internal/utils.ts +178 -0
  110. package/src/utils/push/ios.ts +49 -115
  111. package/src/utils/push/libs/expoNotifications.ts +4 -0
  112. package/src/utils/push/libs/index.ts +0 -1
  113. package/src/utils/push/libs/iosPushNotification.ts +4 -0
  114. package/src/utils/push/utils.ts +44 -175
  115. package/src/version.ts +1 -1
  116. package/dist/commonjs/utils/push/libs/expoTaskManager.js +0 -17
  117. package/dist/commonjs/utils/push/libs/expoTaskManager.js.map +0 -1
  118. package/dist/commonjs/utils/push/rxSubjects.js.map +0 -1
  119. package/dist/module/utils/push/libs/expoTaskManager.js +0 -11
  120. package/dist/module/utils/push/libs/expoTaskManager.js.map +0 -1
  121. package/dist/module/utils/push/rxSubjects.js.map +0 -1
  122. package/dist/typescript/utils/push/libs/expoTaskManager.d.ts +0 -3
  123. package/dist/typescript/utils/push/libs/expoTaskManager.d.ts.map +0 -1
  124. package/dist/typescript/utils/push/rxSubjects.d.ts.map +0 -1
  125. package/src/utils/push/libs/expoTaskManager.ts +0 -16
  126. /package/dist/commonjs/utils/push/{rxSubjects.js → internal/rxSubjects.js} +0 -0
  127. /package/dist/module/utils/push/{rxSubjects.js → internal/rxSubjects.js} +0 -0
@@ -1,6 +1,7 @@
1
1
  export declare const generateCallTitle: (memberUserIds: string[], totalMembersToShow?: number) => string;
2
2
  export declare const generateParticipantTitle: (memberUserId: string) => string;
3
3
  export declare const getInitialsOfName: (name: string) => string;
4
+ export * from './push/index';
4
5
  export * from './enterPiPAndroid';
5
6
  export * from './StreamVideoRN';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,kBACb,MAAM,EAAE,uBACF,MAAM,WAgB5B,CAAC;AAGF,eAAO,MAAM,wBAAwB,iBAAkB,MAAM,WAI5D,CAAC;AAGF,eAAO,MAAM,iBAAiB,SAAU,MAAM,WAS7C,CAAC;AAEF,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,kBACb,MAAM,EAAE,uBACF,MAAM,WAgB5B,CAAC;AAGF,eAAO,MAAM,wBAAwB,iBAAkB,MAAM,WAI5D,CAAC;AAGF,eAAO,MAAM,iBAAiB,SAAU,MAAM,WAS7C,CAAC;AAEF,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -1,9 +1,19 @@
1
1
  import { StreamVideoClient } from '@stream-io/video-client';
2
2
  import type { StreamVideoConfig } from '../StreamVideoRN/types';
3
+ import { NotifeeLib, FirebaseMessagingTypes } from './libs';
3
4
  type PushConfig = NonNullable<StreamVideoConfig['push']>;
4
- /** Setup Firebase push message handler **/
5
- export declare function setupFirebaseHandlerAndroid(pushConfig: PushConfig): void;
5
+ type onBackgroundEventFunctionParams = Parameters<NotifeeLib['default']['onBackgroundEvent']>[0];
6
+ type Event = Parameters<onBackgroundEventFunctionParams>[0];
6
7
  /** Send token to stream, create notification channel, */
7
8
  export declare function initAndroidPushToken(client: StreamVideoClient, pushConfig: PushConfig, setUnsubscribeListener: (unsubscribe: () => void) => void): Promise<void>;
9
+ /**
10
+ * Creates notification from the push message data.
11
+ * For Ringing and Non-Ringing calls.
12
+ */
13
+ export declare const firebaseDataHandler: (data: FirebaseMessagingTypes.RemoteMessage["data"]) => Promise<void>;
14
+ export declare const onAndroidNotifeeEvent: ({ event, isBackground, }: {
15
+ event: Event;
16
+ isBackground: boolean;
17
+ }) => Promise<void>;
8
18
  export {};
9
19
  //# sourceMappingURL=android.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/android.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,iBAAiB,EAElB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AA6BhC,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAYzD,2CAA2C;AAC3C,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,UAAU,QA8EjE;AAED,0DAA0D;AAC1D,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,KAAK,IAAI,iBA+C1D"}
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/android.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAElB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,UAAU,EACV,sBAAsB,EACvB,MAAM,QAAQ,CAAC;AAsBhB,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAEzD,KAAK,+BAA+B,GAAG,UAAU,CAC/C,UAAU,CAAC,SAAS,CAAC,CAAC,mBAAmB,CAAC,CAC3C,CAAC,CAAC,CAAC,CAAC;AAEL,KAAK,KAAK,GAAG,UAAU,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,CAAC;AAI5D,0DAA0D;AAC1D,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,KAAK,IAAI,iBA+C1D;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,SACxB,sBAAsB,CAAC,aAAa,CAAC,MAAM,CAAC,kBA+LnD,CAAC;AAEF,eAAO,MAAM,qBAAqB,6BAG/B;IACD,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;CACvB,kBA2EA,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './android';
2
+ export * from './ios';
3
+ export * from './utils';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { BehaviorSubject } from 'rxjs';
2
- import { NonRingingPushEvent } from '../StreamVideoRN/types';
2
+ import { NonRingingPushEvent } from '../../StreamVideoRN/types';
3
3
  /**
4
4
  * This rxjs subject is used to store the call cid of the accepted incoming call from push notification
5
5
  * Note: it is should be subscribed only when a user has connected to the websocket of Stream
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rxSubjects.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/rxSubjects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,uBAAuB;SAC3B,MAAM;UAAQ,mBAAmB;cAC9B,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qCAE7B,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,0BAA0B,qCAE3B,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,8CAA8C,qCACP,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qCAE7B,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,4BAA4B,qCAE7B,CAAC;AAEb,sFAAsF;AACtF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAOF,eAAO,MAAM,gCAAgC,0CAEjC,CAAC;AAKb,eAAO,MAAM,0CAA0C,0CAE3C,CAAC;AAEb,KAAK,mBAAmB,GAAG,MAAM,IAAI,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,4BAA4B,oDAE7B,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { Call, StreamVideoClient } from '@stream-io/video-client';
2
+ import type { NonRingingPushEvent, StreamVideoConfig } from '../../StreamVideoRN/types';
3
+ type PushConfig = NonNullable<StreamVideoConfig['push']>;
4
+ type CanAddPushWSSubscriptionsRef = {
5
+ current: boolean;
6
+ };
7
+ /**
8
+ * This function is used to check if the call should be ended based on the push notification
9
+ * Useful for callkeep management to end the call if necessary (with reportEndCallWithUUID)
10
+ */
11
+ export declare const shouldCallBeEnded: (callFromPush: Call, created_by_id: string | undefined, receiver_id: string | undefined) => {
12
+ mustEndCall: boolean;
13
+ callkeepReason: number;
14
+ };
15
+ export declare const processCallFromPushInBackground: (pushConfig: PushConfig, call_cid: string, action: Parameters<typeof processCallFromPush>[2]) => Promise<void>;
16
+ /**
17
+ * This function is used process the call from push notifications due to incoming call
18
+ * It does the following steps:
19
+ * 1. Get the call from the client if present or create a new call
20
+ * 2. Fetch the latest state of the call from the server if its not already in ringing state
21
+ * 3. Join or leave the call based on the user's action.
22
+ */
23
+ export declare const processCallFromPush: (client: StreamVideoClient, call_cid: string, action: "accept" | "decline" | "pressed" | "backgroundDelivered", pushConfig: PushConfig) => Promise<void>;
24
+ /**
25
+ * This function is used process the call from push notifications due to non ringing calls
26
+ * It does the following steps:
27
+ * 1. Get the call from the client if present or create a new call
28
+ * 2. Fetch the latest state of the call from the server
29
+ * 3. Call all the callbacks to inform the app about the call
30
+ */
31
+ export declare const processNonIncomingCallFromPush: (client: StreamVideoClient, call_cid: string, nonRingingNotificationType: NonRingingPushEvent) => Promise<void>;
32
+ /**
33
+ * This function is used to clear all the push related WS subscriptions
34
+ * note: events are subscribed in push for accept/decline through WS
35
+ */
36
+ export declare const clearPushWSEventSubscriptions: () => void;
37
+ /**
38
+ * This ref is used to check if the push WS subscriptions can be added
39
+ * It is used to avoid adding the push WS subscriptions when the client is connected to WS in the foreground
40
+ */
41
+ export declare const canAddPushWSSubscriptionsRef: CanAddPushWSSubscriptionsRef;
42
+ export {};
43
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEJ,iBAAiB,EAElB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAInC,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,iBACd,IAAI,iBACH,MAAM,GAAG,SAAS,eACpB,MAAM,GAAG,SAAS;;;CAmChC,CAAC;AAMF,eAAO,MAAM,+BAA+B,eAC9B,UAAU,YACZ,MAAM,UACR,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,kBAelD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WACtB,iBAAiB,YACf,MAAM,UACR,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,qBAAqB,cACpD,UAAU,kBA4BvB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,WACjC,iBAAiB,YACf,MAAM,8BACY,mBAAmB,kBAmBhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,YAQzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,4BAE1C,CAAC"}
@@ -1,9 +1,14 @@
1
1
  import type { StreamVideoConfig } from '../StreamVideoRN/types';
2
+ import { ExpoNotification, PushNotificationiOSType } from './libs';
2
3
  import { StreamVideoClient } from '@stream-io/video-client';
4
+ import { Event } from '@notifee/react-native';
3
5
  type PushConfig = NonNullable<StreamVideoConfig['push']>;
4
- export declare const iosCallkeepAcceptCall: (call_cid: string | undefined, callUUIDFromCallkeep: string) => void;
5
- export declare const iosCallkeepRejectCall: (call_cid: string | undefined, callUUIDFromCallkeep: string, pushConfig: PushConfig) => Promise<void>;
6
- export declare const setupRemoteNotificationsHandleriOS: (pushConfig: PushConfig) => void;
6
+ export declare const oniOSExpoNotificationEvent: (event: ExpoNotification) => void;
7
+ export declare const oniOSNotifeeEvent: ({ event, }: {
8
+ event: Event;
9
+ isBackground: boolean;
10
+ }) => void;
11
+ export declare function onPushNotificationiOSStreamVideoEvent(notification: PushNotificationiOSType): void;
7
12
  /** Send token to stream */
8
13
  export declare function initIosNonVoipToken(client: StreamVideoClient, pushConfig: PushConfig, setUnsubscribeListener: (unsubscribe: () => void) => void): Promise<void>;
9
14
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/ios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAiBhC,OAAO,EAAE,iBAAiB,EAAa,MAAM,yBAAyB,CAAC;AAGvE,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AA0BzD,eAAO,MAAM,qBAAqB,aACtB,MAAM,GAAG,SAAS,wBACN,MAAM,SAe7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,aACtB,MAAM,GAAG,SAAS,wBACN,MAAM,cAChB,UAAU,kBAWvB,CAAC;AAgBF,eAAO,MAAM,kCAAkC,eAAgB,UAAU,SA+BxE,CAAC;AAEF,2BAA2B;AAC3B,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,KAAK,IAAI,iBAmE1D"}
1
+ {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/ios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EACL,gBAAgB,EAGhB,uBAAuB,EACxB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,iBAAiB,EAAa,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAa,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAIzD,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAkBzD,eAAO,MAAM,0BAA0B,UAAW,gBAAgB,SASjE,CAAC;AAEF,eAAO,MAAM,iBAAiB,eAE3B;IACD,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,OAAO,CAAC;CACvB,SAaA,CAAC;AAEF,wBAAgB,qCAAqC,CACnD,YAAY,EAAE,uBAAuB,QAiBtC;AAED,2BAA2B;AAC3B,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,IAAI,KAAK,IAAI,iBAiD1D"}
@@ -1,3 +1,5 @@
1
1
  export type ExpoNotificationsLib = typeof import('expo-notifications');
2
+ import type { Notification } from 'expo-notifications';
3
+ export type ExpoNotification = Notification;
2
4
  export declare function getExpoNotificationsLib(): typeof import("expo-notifications");
3
5
  //# sourceMappingURL=expoNotifications.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expoNotifications.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/libs/expoNotifications.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,cAAc,oBAAoB,CAAC,CAAC;AAQvE,wBAAgB,uBAAuB,wCAOtC"}
1
+ {"version":3,"file":"expoNotifications.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/libs/expoNotifications.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,cAAc,oBAAoB,CAAC,CAAC;AAEvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAQ5C,wBAAgB,uBAAuB,wCAOtC"}
@@ -1,5 +1,4 @@
1
1
  export * from './expoNotifications';
2
- export * from './expoTaskManager';
3
2
  export * from './firebaseMessaging';
4
3
  export * from './iosPushNotification';
5
4
  export * from './voipPushNotification';
@@ -1 +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;AAC3B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/push/libs/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export type PushNotificationIosLib = typeof import('@react-native-community/push-notification-ios').default;
2
+ import type { PushNotification } from '@react-native-community/push-notification-ios';
3
+ export type PushNotificationiOSType = PushNotification;
2
4
  export declare function getPushNotificationIosLib(): import("@react-native-community/push-notification-ios").PushNotificationIOSStatic;
3
5
  //# sourceMappingURL=iosPushNotification.d.ts.map
@@ -1 +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"}
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;AAIzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;AAOvD,wBAAgB,yBAAyB,sFAOxC"}
@@ -1,43 +1,15 @@
1
- import { Call, StreamVideoClient } from '@stream-io/video-client';
2
- import type { NonRingingPushEvent, StreamVideoConfig } from '../StreamVideoRN/types';
3
- type PushConfig = NonNullable<StreamVideoConfig['push']>;
4
- type CanAddPushWSSubscriptionsRef = {
5
- current: boolean;
6
- };
7
- /**
8
- * This function is used to check if the call should be ended based on the push notification
9
- * Useful for callkeep management to end the call if necessary (with reportEndCallWithUUID)
10
- */
11
- export declare const shouldCallBeEnded: (callFromPush: Call, created_by_id: string | undefined, receiver_id: string | undefined) => {
12
- mustEndCall: boolean;
13
- callkeepReason: number;
14
- };
15
- export declare const processCallFromPushInBackground: (pushConfig: PushConfig, call_cid: string, action: Parameters<typeof processCallFromPush>[2]) => Promise<void>;
16
- /**
17
- * This function is used process the call from push notifications due to incoming call
18
- * It does the following steps:
19
- * 1. Get the call from the client if present or create a new call
20
- * 2. Fetch the latest state of the call from the server if its not already in ringing state
21
- * 3. Join or leave the call based on the user's action.
22
- */
23
- export declare const processCallFromPush: (client: StreamVideoClient, call_cid: string, action: "accept" | "decline" | "pressed" | "backgroundDelivered", pushConfig: PushConfig) => Promise<void>;
24
- /**
25
- * This function is used process the call from push notifications due to non ringing calls
26
- * It does the following steps:
27
- * 1. Get the call from the client if present or create a new call
28
- * 2. Fetch the latest state of the call from the server if its not already in ringing state
29
- * 3. Call all the callbacks to inform the app about the call
30
- */
31
- export declare const processNonIncomingCallFromPush: (client: StreamVideoClient, call_cid: string, nonRingingNotificationType: NonRingingPushEvent) => Promise<void>;
32
- /**
33
- * This function is used to clear all the push related WS subscriptions
34
- * note: events are subscribed in push for accept/decline through WS
35
- */
36
- export declare const clearPushWSEventSubscriptions: () => void;
37
- /**
38
- * This ref is used to check if the push WS subscriptions can be added
39
- * It is used to avoid adding the push WS subscriptions when the client is connected to WS in the foreground
40
- */
41
- export declare const canAddPushWSSubscriptionsRef: CanAddPushWSSubscriptionsRef;
42
- export {};
1
+ import { Event } from '@notifee/react-native';
2
+ import { FirebaseMessagingTypes } from './libs/firebaseMessaging';
3
+ import { ExpoNotification } from './libs/expoNotifications';
4
+ import { NonRingingPushEvent } from '../StreamVideoRN/types';
5
+ import { PushNotificationiOSType } from './libs/iosPushNotification';
6
+ export type StreamPushPayload = {
7
+ call_cid: string;
8
+ type: 'call.ring' | NonRingingPushEvent;
9
+ sender: string;
10
+ } | undefined;
11
+ export declare function isFirebaseStreamVideoMessage(message: FirebaseMessagingTypes.RemoteMessage): boolean;
12
+ export declare function isNotifeeStreamVideoEvent(event: Event): boolean;
13
+ export declare function isExpoNotificationStreamVideoEvent(event: ExpoNotification): boolean | undefined;
14
+ export declare function isPushNotificationiOSStreamVideoEvent(notification: PushNotificationiOSType): boolean;
43
15
  //# 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,EACL,IAAI,EAGJ,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAIhC,KAAK,UAAU,GAAG,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAEzD,KAAK,4BAA4B,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,iBACd,IAAI,iBACH,MAAM,GAAG,SAAS,eACpB,MAAM,GAAG,SAAS;;;CAmChC,CAAC;AAMF,eAAO,MAAM,+BAA+B,eAC9B,UAAU,YACZ,MAAM,UACR,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,kBAelD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WACtB,iBAAiB,YACf,MAAM,UACR,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,qBAAqB,cACpD,UAAU,kBA4BvB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,WACjC,iBAAiB,YACf,MAAM,8BACY,mBAAmB,kBAmBhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,YAQzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,4BAE1C,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/utils/push/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,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;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,KAAK,WAIrD;AAED,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,gBAAgB,uBAYzE;AAED,wBAAgB,qCAAqC,CACnD,YAAY,EAAE,uBAAuB,WAKtC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.2.14";
1
+ export declare const version = "1.3.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "1.2.14",
3
+ "version": "1.3.0",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "module": "dist/module/index.js",
@@ -46,8 +46,8 @@
46
46
  "!**/.*"
47
47
  ],
48
48
  "dependencies": {
49
- "@stream-io/video-client": "1.10.5",
50
- "@stream-io/video-react-bindings": "1.1.16",
49
+ "@stream-io/video-client": "1.11.0",
50
+ "@stream-io/video-react-bindings": "1.1.17",
51
51
  "intl-pluralrules": "2.0.1",
52
52
  "lodash.merge": "^4.6.2",
53
53
  "react-native-url-polyfill": "1.3.0",
@@ -65,7 +65,6 @@
65
65
  "expo": ">=47.0.0",
66
66
  "expo-build-properties": "*",
67
67
  "expo-notifications": "*",
68
- "expo-task-manager": "*",
69
68
  "react": ">=17.0.0",
70
69
  "react-native": ">=0.67.0",
71
70
  "react-native-callkeep": ">=4.3.11",
@@ -100,9 +99,6 @@
100
99
  "expo-notifications": {
101
100
  "optional": true
102
101
  },
103
- "expo-task-manager": {
104
- "optional": true
105
- },
106
102
  "react-native-callkeep": {
107
103
  "optional": true
108
104
  },
@@ -122,8 +118,8 @@
122
118
  "@notifee/react-native": "7.8.0",
123
119
  "@react-native-community/netinfo": "9.3.9",
124
120
  "@react-native-community/push-notification-ios": "1.11.0",
125
- "@react-native-firebase/app": "17.5.0",
126
- "@react-native-firebase/messaging": "17.5.0",
121
+ "@react-native-firebase/app": "19.2.2",
122
+ "@react-native-firebase/messaging": "19.2.2",
127
123
  "@react-native/eslint-config": "^0.74.84",
128
124
  "@stream-io/react-native-webrtc": "118.1.0",
129
125
  "@stream-io/video-filters-react-native": "^0.2.4",
@@ -139,8 +135,7 @@
139
135
  "expo": "50.0.19",
140
136
  "expo-build-properties": "^0.12.3",
141
137
  "expo-modules-core": "1.12.16",
142
- "expo-notifications": "~0.27.8",
143
- "expo-task-manager": "~11.7.3",
138
+ "expo-notifications": "~0.28.18",
144
139
  "jest": "^29.7.0",
145
140
  "react-native": "0.71.8",
146
141
  "react-native-builder-bob": "^0.23.2",
@@ -2,16 +2,23 @@ import { useEffect } from 'react';
2
2
  import {
3
3
  voipCallkeepCallOnForegroundMap$,
4
4
  voipPushNotificationCallCId$,
5
- } from '../../utils/push/rxSubjects';
5
+ } from '../../utils/push/internal/rxSubjects';
6
6
  import { RxUtils } from '@stream-io/video-client';
7
- import {
8
- iosCallkeepAcceptCall,
9
- iosCallkeepRejectCall,
10
- } from '../../utils/push/ios';
11
7
  import { getCallKeepLib } from '../../utils/push/libs';
12
- import { StreamVideoRN } from '../../utils';
8
+ import { StreamVideoRN } from '../../utils/StreamVideoRN';
9
+ import type { StreamVideoConfig } from '../../utils/StreamVideoRN/types';
10
+ import {
11
+ clearPushWSEventSubscriptions,
12
+ processCallFromPushInBackground,
13
+ } from '../../utils/push/internal/utils';
14
+ import {
15
+ pushAcceptedIncomingCallCId$,
16
+ voipCallkeepAcceptedCallOnNativeDialerMap$,
17
+ } from '../../utils/push/internal/rxSubjects';
13
18
  import { Platform } from 'react-native';
14
19
 
20
+ type PushConfig = NonNullable<StreamVideoConfig['push']>;
21
+
15
22
  /**
16
23
  * This hook is used to listen to callkeep events and do the necessary actions
17
24
  */
@@ -62,3 +69,52 @@ export const useIosCallKeepEventsSetupEffect = () => {
62
69
  };
63
70
  }, []);
64
71
  };
72
+
73
+ const iosCallkeepAcceptCall = (
74
+ call_cid: string | undefined,
75
+ callUUIDFromCallkeep: string
76
+ ) => {
77
+ if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
78
+ return;
79
+ }
80
+ clearPushWSEventSubscriptions();
81
+ // to call end callkeep later if ended in app and not through callkeep
82
+ voipCallkeepAcceptedCallOnNativeDialerMap$.next({
83
+ uuid: callUUIDFromCallkeep,
84
+ cid: call_cid,
85
+ });
86
+ // to process the call in the app
87
+ pushAcceptedIncomingCallCId$.next(call_cid);
88
+ // no need to keep these references anymore
89
+ voipCallkeepCallOnForegroundMap$.next(undefined);
90
+ };
91
+
92
+ const iosCallkeepRejectCall = async (
93
+ call_cid: string | undefined,
94
+ callUUIDFromCallkeep: string,
95
+ pushConfig: PushConfig
96
+ ) => {
97
+ if (!shouldProcessCallFromCallkeep(call_cid, callUUIDFromCallkeep)) {
98
+ return;
99
+ }
100
+ clearPushWSEventSubscriptions();
101
+ // no need to keep these references anymore
102
+ voipCallkeepAcceptedCallOnNativeDialerMap$.next(undefined);
103
+ voipCallkeepCallOnForegroundMap$.next(undefined);
104
+ voipPushNotificationCallCId$.next(undefined);
105
+ await processCallFromPushInBackground(pushConfig, call_cid, 'decline');
106
+ };
107
+
108
+ /**
109
+ * Helper function to determine if the answer/end call event from callkeep must be processed
110
+ * Just checks if we have a valid call_cid and acts as a type guard for call_cid
111
+ */
112
+ const shouldProcessCallFromCallkeep = (
113
+ call_cid: string | undefined,
114
+ callUUIDFromCallkeep: string
115
+ ): call_cid is string => {
116
+ if (!call_cid || !callUUIDFromCallkeep) {
117
+ return false;
118
+ }
119
+ return true;
120
+ };
@@ -7,7 +7,7 @@ import { getCallKeepLib } from '../../utils/push/libs';
7
7
  import {
8
8
  voipCallkeepAcceptedCallOnNativeDialerMap$,
9
9
  voipCallkeepCallOnForegroundMap$,
10
- } from '../../utils/push/rxSubjects';
10
+ } from '../../utils/push/internal/rxSubjects';
11
11
 
12
12
  const isNonActiveCallingState = (callingState: CallingState) => {
13
13
  return (
@@ -12,11 +12,11 @@ import { NativeModules } from 'react-native';
12
12
  import {
13
13
  canAddPushWSSubscriptionsRef,
14
14
  shouldCallBeEnded,
15
- } from '../../utils/push/utils';
15
+ } from '../../utils/push/internal/utils';
16
16
  import {
17
17
  pushUnsubscriptionCallbacks$,
18
18
  voipPushNotificationCallCId$,
19
- } from '../../utils/push/rxSubjects';
19
+ } from '../../utils/push/internal/rxSubjects';
20
20
  import { RxUtils, getLogger } from '@stream-io/video-client';
21
21
 
22
22
  let lastVoipToken = { token: '', userId: '' };
@@ -3,7 +3,7 @@ import {
3
3
  pushAndroidBackgroundDeliveredIncomingCallCId$,
4
4
  pushRejectedIncomingCallCId$,
5
5
  pushTappedIncomingCallCId$,
6
- } from '../../utils/push/rxSubjects';
6
+ } from '../../utils/push/internal/rxSubjects';
7
7
  import { useEffect } from 'react';
8
8
  import { StreamVideoRN } from '../../utils';
9
9
  import {
@@ -12,7 +12,7 @@ import {
12
12
  } from '@stream-io/video-react-bindings';
13
13
  import { BehaviorSubject } from 'rxjs';
14
14
  import { filter } from 'rxjs/operators';
15
- import { processCallFromPush } from '../../utils/push/utils';
15
+ import { processCallFromPush } from '../../utils/push/internal/utils';
16
16
  import { StreamVideoClient } from '@stream-io/video-client';
17
17
  import type { StreamVideoConfig } from '../../utils/StreamVideoRN/types';
18
18
 
@@ -92,11 +92,6 @@ const createCallSubscription = (
92
92
  .pipe(filter(cidIsNotUndefined))
93
93
  .subscribe(async (callCId) => {
94
94
  await processCallFromPush(client, callCId, action, pushConfig);
95
- if (action === 'accept') {
96
- pushConfig.navigateAcceptCall();
97
- } else if (action === 'pressed' || action === 'backgroundDelivered') {
98
- pushConfig.navigateToIncomingCall();
99
- }
100
95
  behaviourSubjectWithCallCid.next(undefined); // remove the current call id to avoid processing again
101
96
  });
102
97
  };
@@ -1,4 +1,4 @@
1
- import { pushNonRingingCallData$ } from '../../utils/push/rxSubjects';
1
+ import { pushNonRingingCallData$ } from '../../utils/push/internal/rxSubjects';
2
2
  import { useEffect } from 'react';
3
3
  import { StreamVideoRN } from '../../utils';
4
4
  import {
@@ -6,7 +6,7 @@ import {
6
6
  useStreamVideoClient,
7
7
  } from '@stream-io/video-react-bindings';
8
8
  import { filter } from 'rxjs/operators';
9
- import { processNonIncomingCallFromPush } from '../../utils/push/utils';
9
+ import { processNonIncomingCallFromPush } from '../../utils/push/internal/utils';
10
10
 
11
11
  /**
12
12
  * This hook is used to process the non ringing call data via push notifications using the relevant rxjs subject
@@ -16,7 +16,7 @@ import { processNonIncomingCallFromPush } from '../../utils/push/utils';
16
16
  export const useProcessPushNonRingingCallEffect = () => {
17
17
  const client = useStreamVideoClient();
18
18
  const connectedUserId = useConnectedUser()?.id;
19
- // The Effect to join/reject call automatically when incoming call was received and processed from push notification
19
+ // The Effect to automatically add the non ringing call to our low level client state
20
20
  useEffect(() => {
21
21
  const pushConfig = StreamVideoRN.getConfig().push;
22
22
  if (!pushConfig || !client || !connectedUserId) {
@@ -37,6 +37,7 @@ async function startForegroundService(call_cid: string) {
37
37
  );
38
38
  return;
39
39
  }
40
+ // channel id is not required for notifee as its only used on android 7 and below here
40
41
  await notifeeLib.default.displayNotification({
41
42
  id: call_cid,
42
43
  title,
@@ -5,7 +5,7 @@ import { useIosCallkeepWithCallingStateEffect } from '../hooks/push/useIosCallke
5
5
  import {
6
6
  canAddPushWSSubscriptionsRef,
7
7
  clearPushWSEventSubscriptions,
8
- } from '../utils/push/utils';
8
+ } from '../utils/push/internal/utils';
9
9
  import { useAndroidKeepCallAliveEffect } from '../hooks/useAndroidKeepCallAliveEffect';
10
10
  import { AppState, NativeModules, Platform } from 'react-native';
11
11
  import { shouldDisableIOSLocalVideoOnBackgroundRef } from '../utils/internal/shouldDisableIOSLocalVideoOnBackground';
@@ -1,7 +1,5 @@
1
- import { setupFirebaseHandlerAndroid } from '../push/android';
2
1
  import { StreamVideoConfig } from './types';
3
2
  import pushLogoutCallbacks from '../internal/pushLogoutCallback';
4
- import { setupRemoteNotificationsHandleriOS } from '../push/ios';
5
3
  import newNotificationCallbacks, {
6
4
  NewCallNotificationCallback,
7
5
  } from '../internal/newNotificationCallbacks';
@@ -66,11 +64,18 @@ export class StreamVideoRN {
66
64
  // Ignoring this config as push config was already set
67
65
  return;
68
66
  }
67
+ if (
68
+ __DEV__ &&
69
+ (pushConfig.navigateAcceptCall || pushConfig.navigateToIncomingCall)
70
+ ) {
71
+ throw new Error(
72
+ `Support for navigateAcceptCall or navigateToIncomingCall in pushConfig has been removed.
73
+ Please watch for incoming and outgoing calls in the root component of your app.
74
+ Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information.`
75
+ );
76
+ }
77
+
69
78
  this.config.push = pushConfig;
70
- // After getting the config we should setup callkeep events, firebase handler asap to handle incoming calls from a dead state
71
- setupFirebaseHandlerAndroid(pushConfig);
72
- // setup ios handler for non-voip push notifications asap
73
- setupRemoteNotificationsHandleriOS(pushConfig);
74
79
  }
75
80
 
76
81
  static getConfig() {
@@ -107,10 +107,12 @@ export type StreamVideoConfig = {
107
107
  * }
108
108
  */
109
109
  createStreamVideoClient: () => Promise<StreamVideoClient | undefined>;
110
- /** The callback that is called when a call is accepted, used for navigation */
111
- navigateAcceptCall: () => void;
112
- /** The callback that is called when a push notification is tapped but user did not press accept or decline, used for navigation */
113
- navigateToIncomingCall: () => void;
110
+ /** @deprecated This method will be removed in the future. Please watch for incoming and outgoing calls in the root component of your app.
111
+ Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information */
112
+ navigateAcceptCall?: () => void;
113
+ /** @deprecated This method will be removed in the future. Please watch for incoming and outgoing calls in the root component of your app.
114
+ Please see https://getstream.io/video/docs/react-native/advanced/ringing-calls/#watch-for-incoming-and-outgoing-calls for more information */
115
+ navigateToIncomingCall?: () => void;
114
116
  /** Callback that is called when a non ringing push notification was tapped */
115
117
  onTapNonRingingCallNotification?: (
116
118
  call_cid: string,
@@ -38,5 +38,6 @@ export const getInitialsOfName = (name: string) => {
38
38
  return initials;
39
39
  };
40
40
 
41
+ export * from './push/index';
41
42
  export * from './enterPiPAndroid';
42
43
  export * from './StreamVideoRN';