@stream-io/video-react-native-sdk 0.0.1-alpha.199 → 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,24 @@
|
|
|
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
|
+
|
|
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)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* add null check to callkeep end call effect ([#695](https://github.com/GetStream/stream-video-js/issues/695)) ([8303679](https://github.com/GetStream/stream-video-js/commit/830367929b5db49af23ec5656dc44a07d363d4c5))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
5
23
|
## [0.0.1-alpha.199](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.1-alpha.198...@stream-io/video-react-native-sdk-0.0.1-alpha.199) (2023-06-22)
|
|
6
24
|
|
|
7
25
|
|
|
@@ -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
|
|
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,25 +27,27 @@ 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 (
|
|
31
|
-
callkeep.endCall(
|
|
32
|
-
|
|
30
|
+
if (currentRingingActiveCallIdRef.current) {
|
|
31
|
+
callkeep.endCall(currentRingingActiveCallIdRef.current);
|
|
32
|
+
currentRingingActiveCallIdRef.current = undefined;
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
}, []);
|
|
36
|
+
const activeCallId = activeCall?.id;
|
|
36
37
|
const pushConfig = utils_1.StreamVideoRN.getConfig().push;
|
|
37
|
-
if (react_native_1.Platform.OS !== 'ios' || !pushConfig) {
|
|
38
|
+
if (react_native_1.Platform.OS !== 'ios' || !pushConfig || !activeCallId) {
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
|
-
if (
|
|
41
|
-
|
|
41
|
+
if (activeCall.ringing) {
|
|
42
|
+
currentRingingActiveCallIdRef.current = activeCallId;
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
45
|
// the current call has ended, so report it to callkeep asap
|
|
45
|
-
if (
|
|
46
|
+
if (isNonActiveCallingState(callingState) &&
|
|
47
|
+
activeCallId === currentRingingActiveCallIdRef.current) {
|
|
46
48
|
const callkeep = (0, libs_1.getCallKeepLib)();
|
|
47
|
-
callkeep.endCall(
|
|
48
|
-
|
|
49
|
+
callkeep.endCall(activeCallId);
|
|
50
|
+
currentRingingActiveCallIdRef.current = undefined;
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
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,
|
|
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,6BAA6B,GAAG,IAAA,cAAM,GAAU,CAAC;IAEvD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,qBAAa,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC;QAClD,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,UAAU,EAAE;YACxC,OAAO;SACR;QACD,MAAM,QAAQ,GAAG,IAAA,qBAAc,GAAE,CAAC;QAClC,OAAO,GAAG,EAAE;YACV,gGAAgG;YAChG,IAAI,6BAA6B,CAAC,OAAO,EAAE;gBACzC,QAAQ,CAAC,OAAO,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC;gBACxD,6BAA6B,CAAC,OAAO,GAAG,SAAS,CAAC;aACnD;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,UAAU,EAAE,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,qBAAa,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC;IAClD,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,UAAU,IAAI,CAAC,YAAY,EAAE;QACzD,OAAO;KACR;IACD,IAAI,UAAU,CAAC,OAAO,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
|
@@ -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
|
|
22
|
+
const currentRingingActiveCallIdRef = useRef<string>();
|
|
23
23
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
const pushConfig = StreamVideoRN.getConfig().push;
|
|
@@ -29,25 +29,29 @@ 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 (
|
|
33
|
-
callkeep.endCall(
|
|
34
|
-
|
|
32
|
+
if (currentRingingActiveCallIdRef.current) {
|
|
33
|
+
callkeep.endCall(currentRingingActiveCallIdRef.current);
|
|
34
|
+
currentRingingActiveCallIdRef.current = undefined;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
}, []);
|
|
38
38
|
|
|
39
|
+
const activeCallId = activeCall?.id;
|
|
39
40
|
const pushConfig = StreamVideoRN.getConfig().push;
|
|
40
|
-
if (Platform.OS !== 'ios' || !pushConfig) {
|
|
41
|
+
if (Platform.OS !== 'ios' || !pushConfig || !activeCallId) {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
|
-
if (
|
|
44
|
-
|
|
44
|
+
if (activeCall.ringing) {
|
|
45
|
+
currentRingingActiveCallIdRef.current = activeCallId;
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
48
|
// the current call has ended, so report it to callkeep asap
|
|
48
|
-
if (
|
|
49
|
+
if (
|
|
50
|
+
isNonActiveCallingState(callingState) &&
|
|
51
|
+
activeCallId === currentRingingActiveCallIdRef.current
|
|
52
|
+
) {
|
|
49
53
|
const callkeep = getCallKeepLib();
|
|
50
|
-
callkeep.endCall(
|
|
51
|
-
|
|
54
|
+
callkeep.endCall(activeCallId);
|
|
55
|
+
currentRingingActiveCallIdRef.current = undefined;
|
|
52
56
|
}
|
|
53
57
|
};
|