@stream-io/video-react-native-sdk 0.0.1-alpha.200 → 0.0.1-alpha.201

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.0.1-alpha.201](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.200...@stream-io/video-react-native-sdk-0.0.1-alpha.201) (2023-06-22)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * do not end call in callkeep if its not a ringing call ([90029e1](https://github.com/GetStream/stream-video-js/commit/90029e1bae07751e2f7f5366236c9e5e6d5afdd0))
11
+
12
+
13
+
5
14
  ## [0.0.1-alpha.200](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.199...@stream-io/video-react-native-sdk-0.0.1-alpha.200) (2023-06-22)
6
15
 
7
16
 
@@ -18,7 +18,7 @@ const isNonActiveCallingState = (callingState) => {
18
18
  const useIosCallkeepEndEffect = () => {
19
19
  const activeCall = (0, video_react_bindings_1.useCall)();
20
20
  const callingState = (0, video_react_bindings_1.useCallCallingState)();
21
- const currentActiveCallIdRef = (0, react_1.useRef)();
21
+ const currentRingingActiveCallIdRef = (0, react_1.useRef)();
22
22
  (0, react_1.useEffect)(() => {
23
23
  const pushConfig = utils_1.StreamVideoRN.getConfig().push;
24
24
  if (react_native_1.Platform.OS !== 'ios' || !pushConfig) {
@@ -27,9 +27,9 @@ const useIosCallkeepEndEffect = () => {
27
27
  const callkeep = (0, libs_1.getCallKeepLib)();
28
28
  return () => {
29
29
  // if the component is unmounted and the callID was not reported to callkeep, then report it now
30
- if (currentActiveCallIdRef.current) {
31
- callkeep.endCall(currentActiveCallIdRef.current);
32
- currentActiveCallIdRef.current = undefined;
30
+ if (currentRingingActiveCallIdRef.current) {
31
+ callkeep.endCall(currentRingingActiveCallIdRef.current);
32
+ currentRingingActiveCallIdRef.current = undefined;
33
33
  }
34
34
  };
35
35
  }, []);
@@ -38,15 +38,16 @@ const useIosCallkeepEndEffect = () => {
38
38
  if (react_native_1.Platform.OS !== 'ios' || !pushConfig || !activeCallId) {
39
39
  return;
40
40
  }
41
- if (!isNonActiveCallingState(callingState)) {
42
- currentActiveCallIdRef.current = activeCallId;
41
+ if (activeCall.ringing) {
42
+ currentRingingActiveCallIdRef.current = activeCallId;
43
43
  return;
44
44
  }
45
45
  // the current call has ended, so report it to callkeep asap
46
- if (activeCallId === currentActiveCallIdRef.current) {
46
+ if (isNonActiveCallingState(callingState) &&
47
+ activeCallId === currentRingingActiveCallIdRef.current) {
47
48
  const callkeep = (0, libs_1.getCallKeepLib)();
48
- callkeep.endCall(activeCall?.id);
49
- currentActiveCallIdRef.current = undefined;
49
+ callkeep.endCall(activeCallId);
50
+ currentRingingActiveCallIdRef.current = undefined;
50
51
  }
51
52
  };
52
53
  exports.useIosCallkeepEndEffect = useIosCallkeepEndEffect;
@@ -1 +1 @@
1
- {"version":3,"file":"useIosCallkeepEndEffect.js","sourceRoot":"","sources":["../../../src/hooks/useIosCallkeepEndEffect.ts"],"names":[],"mappings":";;;AAAA,0DAAuD;AACvD,0EAA+E;AAC/E,+CAAwC;AACxC,iCAA0C;AAC1C,oCAAyC;AACzC,6CAAoD;AAEpD,MAAM,uBAAuB,GAAG,CAAC,YAA0B,EAAE,EAAE;IAC7D,OAAO,CACL,YAAY,KAAK,2BAAY,CAAC,IAAI;QAClC,YAAY,KAAK,2BAAY,CAAC,OAAO;QACrC,YAAY,KAAK,2BAAY,CAAC,IAAI,CACnC,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACI,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC1C,MAAM,UAAU,GAAG,IAAA,8BAAO,GAAE,CAAC;IAC7B,MAAM,YAAY,GAAG,IAAA,0CAAmB,GAAE,CAAC;IAC3C,MAAM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AAO,EAAE;QACtB,6BAA6B,CAAC,OAAO,GAAG,YAAY,CAAC;QACrD,OAAO;KACR;IACD,4DAA4D;IAC5D,IACE,uBAAuB,CAAC,YAAY,CAAC;QACrC,YAAY,KAAK,6BAA6B,CAAC,OAAO,EACtD;QACA,MAAM,QAAQ,GAAG,IAAA,qBAAc,GAAE,CAAC;QAClC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC/B,6BAA6B,CAAC,OAAO,GAAG,SAAS,CAAC;KACnD;AACH,CAAC,CAAC;AAtCW,QAAA,uBAAuB,2BAsClC"}
package/package.json CHANGED
@@ -83,5 +83,5 @@
83
83
  "typedoc-plugin-markdown": "^3.15.3",
84
84
  "typescript": "^4.9.5"
85
85
  },
86
- "version": "0.0.1-alpha.200"
86
+ "version": "0.0.1-alpha.201"
87
87
  }
@@ -19,7 +19,7 @@ const isNonActiveCallingState = (callingState: CallingState) => {
19
19
  export const useIosCallkeepEndEffect = () => {
20
20
  const activeCall = useCall();
21
21
  const callingState = useCallCallingState();
22
- const currentActiveCallIdRef = useRef<string>();
22
+ const currentRingingActiveCallIdRef = useRef<string>();
23
23
 
24
24
  useEffect(() => {
25
25
  const pushConfig = StreamVideoRN.getConfig().push;
@@ -29,9 +29,9 @@ export const useIosCallkeepEndEffect = () => {
29
29
  const callkeep = getCallKeepLib();
30
30
  return () => {
31
31
  // if the component is unmounted and the callID was not reported to callkeep, then report it now
32
- if (currentActiveCallIdRef.current) {
33
- callkeep.endCall(currentActiveCallIdRef.current);
34
- currentActiveCallIdRef.current = undefined;
32
+ if (currentRingingActiveCallIdRef.current) {
33
+ callkeep.endCall(currentRingingActiveCallIdRef.current);
34
+ currentRingingActiveCallIdRef.current = undefined;
35
35
  }
36
36
  };
37
37
  }, []);
@@ -41,14 +41,17 @@ export const useIosCallkeepEndEffect = () => {
41
41
  if (Platform.OS !== 'ios' || !pushConfig || !activeCallId) {
42
42
  return;
43
43
  }
44
- if (!isNonActiveCallingState(callingState)) {
45
- currentActiveCallIdRef.current = activeCallId;
44
+ if (activeCall.ringing) {
45
+ currentRingingActiveCallIdRef.current = activeCallId;
46
46
  return;
47
47
  }
48
48
  // the current call has ended, so report it to callkeep asap
49
- if (activeCallId === currentActiveCallIdRef.current) {
49
+ if (
50
+ isNonActiveCallingState(callingState) &&
51
+ activeCallId === currentRingingActiveCallIdRef.current
52
+ ) {
50
53
  const callkeep = getCallKeepLib();
51
- callkeep.endCall(activeCall?.id);
52
- currentActiveCallIdRef.current = undefined;
54
+ callkeep.endCall(activeCallId);
55
+ currentRingingActiveCallIdRef.current = undefined;
53
56
  }
54
57
  };