@stream-io/video-react-native-sdk 1.9.12 → 1.9.13
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 +7 -0
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js +20 -15
- package/dist/commonjs/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js +20 -15
- package/dist/module/hooks/useAndroidKeepCallAliveEffect.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/hooks/useAndroidKeepCallAliveEffect.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/hooks/useAndroidKeepCallAliveEffect.ts +19 -14
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.9.13](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.9.12...@stream-io/video-react-native-sdk-1.9.13) (2025-01-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* rare crash - startForegroundService() did not then call Service.startForeground ([71d11de](https://github.com/GetStream/stream-video-js/commit/71d11de31612f04d4852fccd655e0e39ad2defdf))
|
|
11
|
+
|
|
5
12
|
## [1.9.12](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-1.9.11...@stream-io/video-react-native-sdk-1.9.12) (2025-01-29)
|
|
6
13
|
|
|
7
14
|
### Dependency Updates
|
|
@@ -38,22 +38,27 @@ async function startForegroundService(call_cid) {
|
|
|
38
38
|
const channelId = foregroundServiceConfig.android.channel.id;
|
|
39
39
|
await notifeeLib.default.createChannel(foregroundServiceConfig.android.channel);
|
|
40
40
|
const foregroundServiceTypes = await (0, _notifee.getKeepCallAliveForegroundServiceTypes)();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
// NOTE: we use requestAnimationFrame to ensure that the foreground service is started after all the current UI operations are done
|
|
42
|
+
// this is a workaround for the crash - android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()
|
|
43
|
+
// this crash was reproducible only in some android devices
|
|
44
|
+
requestAnimationFrame(() => {
|
|
45
|
+
notifeeLib.default.displayNotification({
|
|
46
|
+
id: call_cid,
|
|
47
|
+
title,
|
|
48
|
+
body,
|
|
49
|
+
android: {
|
|
50
|
+
channelId,
|
|
51
|
+
foregroundServiceTypes,
|
|
52
|
+
asForegroundService: true,
|
|
53
|
+
ongoing: true,
|
|
54
|
+
// user cannot dismiss the notification
|
|
55
|
+
colorized: true,
|
|
56
|
+
pressAction: {
|
|
57
|
+
id: 'default',
|
|
58
|
+
launchActivity: 'default' // open the app when the notification is pressed
|
|
59
|
+
}
|
|
55
60
|
}
|
|
56
|
-
}
|
|
61
|
+
});
|
|
57
62
|
});
|
|
58
63
|
}
|
|
59
64
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoReactBindings","require","_react","_utils","_reactNative","_videoClient","_notifee","_hooks","notifeeLib","getNotifeeLibNoThrowForKeepCallAlive","setForegroundService","default","registerForegroundService","Promise","logger","getLogger","startForegroundService","call_cid","foregroundServiceConfig","StreamVideoRN","getConfig","foregroundService","title","body","android","notificationTexts","settings","getNotificationSettings","authorizationStatus","AuthorizationStatus","AUTHORIZED","channelId","channel","id","createChannel","foregroundServiceTypes","getKeepCallAliveForegroundServiceTypes","displayNotification","asForegroundService","ongoing","colorized","pressAction","launchActivity","isSetForegroundServiceRan","useAndroidKeepCallAliveEffect","foregroundServiceStartedRef","useRef","call","useCall","activeCallCid","cid","useCallCallingState","useCallStateHooks","callingState","prevCallingState","usePrevious","isStartingToJoin","CallingState","IDLE","JOINING","isStartingToJoinFromRinging","RINGING","isOutgoingCall","isCreatedByMe","isCallJoined","JOINED","shouldStartForegroundService","useEffect","Platform","OS","run","current","notifee","displayedNotifications","getDisplayedNotifications","activeCallNotification","find","notification","stopForegroundService","cancelDisplayedNotification","then","LEFT","exports"],"sourceRoot":"../../../src","sources":["hooks/useAndroidKeepCallAliveEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAIA,IAAAM,MAAA,GAAAN,OAAA;AAEA,MAAMO,UAAU,GAAG,IAAAC,6CAAoC,EAAC,CAAC;AAEzD,SAASC,oBAAoBA,CAAA,EAAG;EAC9BF,UAAU,EAAEG,OAAO,CAACC,yBAAyB,CAAC,MAAM;IAClD,OAAO,IAAIC,OAAO,CAAC,MAAM;MACvB,MAAMC,MAAM,GAAG,IAAAC,sBAAS,EAAC,CAAC,6BAA6B,CAAC,CAAC;MACzDD,MAAM,CAAC,MAAM,EAAE,iDAAiD,CAAC;IACnE,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;AAEA,eAAeE,sBAAsBA,CAACC,QAAgB,EAAE;EACtD,MAAMC,uBAAuB,GAAGC,oBAAa,CAACC,SAAS,CAAC,CAAC,CAACC,iBAAiB;EAC3E,MAAM;IAAEC,KAAK;IAAEC;EAAK,CAAC,GAAGL,uBAAuB,CAACM,OAAO,CAACC,iBAAiB;;EAEzE;EACA,IAAI,CAACjB,UAAU,EAAE;EACjB,MAAMkB,QAAQ,GAAG,MAAMlB,UAAU,CAACG,OAAO,CAACgB,uBAAuB,CAAC,CAAC;EACnE,IACED,QAAQ,CAACE,mBAAmB,KAAKpB,UAAU,CAACqB,mBAAmB,CAACC,UAAU,EAC1E;IACA,MAAMhB,MAAM,GAAG,IAAAC,sBAAS,EAAC,CAAC,wBAAwB,CAAC,CAAC;IACpDD,MAAM,CACJ,MAAM,EACN,8FACF,CAAC;IACD;EACF;EACA,MAAMiB,SAAS,GAAGb,uBAAuB,CAACM,OAAO,CAACQ,OAAO,CAACC,EAAE;EAC5D,MAAMzB,UAAU,CAACG,OAAO,CAACuB,aAAa,CACpChB,uBAAuB,CAACM,OAAO,CAACQ,OAClC,CAAC;EACD,MAAMG,sBAAsB,GAAG,MAAM,IAAAC,+CAAsC,EAAC,CAAC;EAC7E,
|
|
1
|
+
{"version":3,"names":["_videoReactBindings","require","_react","_utils","_reactNative","_videoClient","_notifee","_hooks","notifeeLib","getNotifeeLibNoThrowForKeepCallAlive","setForegroundService","default","registerForegroundService","Promise","logger","getLogger","startForegroundService","call_cid","foregroundServiceConfig","StreamVideoRN","getConfig","foregroundService","title","body","android","notificationTexts","settings","getNotificationSettings","authorizationStatus","AuthorizationStatus","AUTHORIZED","channelId","channel","id","createChannel","foregroundServiceTypes","getKeepCallAliveForegroundServiceTypes","requestAnimationFrame","displayNotification","asForegroundService","ongoing","colorized","pressAction","launchActivity","isSetForegroundServiceRan","useAndroidKeepCallAliveEffect","foregroundServiceStartedRef","useRef","call","useCall","activeCallCid","cid","useCallCallingState","useCallStateHooks","callingState","prevCallingState","usePrevious","isStartingToJoin","CallingState","IDLE","JOINING","isStartingToJoinFromRinging","RINGING","isOutgoingCall","isCreatedByMe","isCallJoined","JOINED","shouldStartForegroundService","useEffect","Platform","OS","run","current","notifee","displayedNotifications","getDisplayedNotifications","activeCallNotification","find","notification","stopForegroundService","cancelDisplayedNotification","then","LEFT","exports"],"sourceRoot":"../../../src","sources":["hooks/useAndroidKeepCallAliveEffect.ts"],"mappings":";;;;;;AAAA,IAAAA,mBAA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AAI,IAClCL,YAAY,KAAKI,yBAAY,CAACwB,IAAI,EAClC;MACA,IAAIpC,2BAA2B,CAAC0B,OAAO,EAAE;QACvC;QACAhE,UAAU,CAACG,OAAO,CAACoE,qBAAqB,CAAC,CAAC;QAC1CjC,2BAA2B,CAAC0B,OAAO,GAAG,KAAK;MAC7C,CAAC,MAAM;QACLhE,UAAU,CAACG,OAAO,CACfgE,yBAAyB,CAAC,CAAC,CAC3BM,IAAI,CAAEP,sBAAsB,IAAK;UAChC,MAAME,sBAAsB,GAAGF,sBAAsB,CAACG,IAAI,CACvDC,YAAY,IAAKA,YAAY,CAAC7C,EAAE,KAAKiB,aACxC,CAAC;UACD,IAAI0B,sBAAsB,EAAE;YAC1B;YACApE,UAAU,CAACG,OAAO,CAACoE,qBAAqB,CAAC,CAAC;UAC5C;QACF,CAAC,CAAC;MACN;IACF;EACF,CAAC,EAAE,CAAC7B,aAAa,EAAEI,YAAY,EAAEa,4BAA4B,CAAC,CAAC;EAE/D,IAAAC,gBAAS,EAAC,MAAM;IACd,OAAO,MAAM;MACX;MACA,IAAItB,2BAA2B,CAAC0B,OAAO,EAAE;QACvC,IAAI,CAAChE,UAAU,EAAE;QACjBA,UAAU,CAACG,OAAO,CAACoE,qBAAqB,CAAC,CAAC;QAC1CjC,2BAA2B,CAAC0B,OAAO,GAAG,KAAK;MAC7C;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAACW,OAAA,CAAAtC,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
package/dist/commonjs/version.js
CHANGED
|
@@ -32,22 +32,27 @@ async function startForegroundService(call_cid) {
|
|
|
32
32
|
const channelId = foregroundServiceConfig.android.channel.id;
|
|
33
33
|
await notifeeLib.default.createChannel(foregroundServiceConfig.android.channel);
|
|
34
34
|
const foregroundServiceTypes = await getKeepCallAliveForegroundServiceTypes();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
// NOTE: we use requestAnimationFrame to ensure that the foreground service is started after all the current UI operations are done
|
|
36
|
+
// this is a workaround for the crash - android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()
|
|
37
|
+
// this crash was reproducible only in some android devices
|
|
38
|
+
requestAnimationFrame(() => {
|
|
39
|
+
notifeeLib.default.displayNotification({
|
|
40
|
+
id: call_cid,
|
|
41
|
+
title,
|
|
42
|
+
body,
|
|
43
|
+
android: {
|
|
44
|
+
channelId,
|
|
45
|
+
foregroundServiceTypes,
|
|
46
|
+
asForegroundService: true,
|
|
47
|
+
ongoing: true,
|
|
48
|
+
// user cannot dismiss the notification
|
|
49
|
+
colorized: true,
|
|
50
|
+
pressAction: {
|
|
51
|
+
id: 'default',
|
|
52
|
+
launchActivity: 'default' // open the app when the notification is pressed
|
|
53
|
+
}
|
|
49
54
|
}
|
|
50
|
-
}
|
|
55
|
+
});
|
|
51
56
|
});
|
|
52
57
|
}
|
|
53
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCall","useCallStateHooks","useEffect","useRef","StreamVideoRN","Platform","CallingState","getLogger","getNotifeeLibNoThrowForKeepCallAlive","getKeepCallAliveForegroundServiceTypes","usePrevious","notifeeLib","setForegroundService","default","registerForegroundService","Promise","logger","startForegroundService","call_cid","foregroundServiceConfig","getConfig","foregroundService","title","body","android","notificationTexts","settings","getNotificationSettings","authorizationStatus","AuthorizationStatus","AUTHORIZED","channelId","channel","id","createChannel","foregroundServiceTypes","displayNotification","asForegroundService","ongoing","colorized","pressAction","launchActivity","isSetForegroundServiceRan","useAndroidKeepCallAliveEffect","foregroundServiceStartedRef","call","activeCallCid","cid","useCallCallingState","callingState","prevCallingState","isStartingToJoin","IDLE","JOINING","isStartingToJoinFromRinging","RINGING","isOutgoingCall","isCreatedByMe","isCallJoined","JOINED","shouldStartForegroundService","OS","run","current","notifee","displayedNotifications","getDisplayedNotifications","activeCallNotification","find","notification","stopForegroundService","cancelDisplayedNotification","then","LEFT"],"sourceRoot":"../../../src","sources":["hooks/useAndroidKeepCallAliveEffect.ts"],"mappings":"AAAA,SAASA,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAASC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,YAAY,EAAEC,SAAS,QAAQ,yBAAyB;AACjE,SACEC,oCAAoC,EACpCC,sCAAsC,QACjC,4BAA4B;AACnC,SAASC,WAAW,QAAQ,gBAAgB;AAE5C,MAAMC,UAAU,GAAGH,oCAAoC,CAAC,CAAC;AAEzD,SAASI,oBAAoBA,CAAA,EAAG;EAC9BD,UAAU,EAAEE,OAAO,CAACC,yBAAyB,CAAC,MAAM;IAClD,OAAO,IAAIC,OAAO,CAAC,MAAM;MACvB,MAAMC,MAAM,GAAGT,SAAS,CAAC,CAAC,6BAA6B,CAAC,CAAC;MACzDS,MAAM,CAAC,MAAM,EAAE,iDAAiD,CAAC;IACnE,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;AAEA,eAAeC,sBAAsBA,CAACC,QAAgB,EAAE;EACtD,MAAMC,uBAAuB,GAAGf,aAAa,CAACgB,SAAS,CAAC,CAAC,CAACC,iBAAiB;EAC3E,MAAM;IAAEC,KAAK;IAAEC;EAAK,CAAC,GAAGJ,uBAAuB,CAACK,OAAO,CAACC,iBAAiB;;EAEzE;EACA,IAAI,CAACd,UAAU,EAAE;EACjB,MAAMe,QAAQ,GAAG,MAAMf,UAAU,CAACE,OAAO,CAACc,uBAAuB,CAAC,CAAC;EACnE,IACED,QAAQ,CAACE,mBAAmB,KAAKjB,UAAU,CAACkB,mBAAmB,CAACC,UAAU,EAC1E;IACA,MAAMd,MAAM,GAAGT,SAAS,CAAC,CAAC,wBAAwB,CAAC,CAAC;IACpDS,MAAM,CACJ,MAAM,EACN,8FACF,CAAC;IACD;EACF;EACA,MAAMe,SAAS,GAAGZ,uBAAuB,CAACK,OAAO,CAACQ,OAAO,CAACC,EAAE;EAC5D,MAAMtB,UAAU,CAACE,OAAO,CAACqB,aAAa,CACpCf,uBAAuB,CAACK,OAAO,CAACQ,OAClC,CAAC;EACD,MAAMG,sBAAsB,GAAG,MAAM1B,sCAAsC,CAAC,CAAC;EAC7E,
|
|
1
|
+
{"version":3,"names":["useCall","useCallStateHooks","useEffect","useRef","StreamVideoRN","Platform","CallingState","getLogger","getNotifeeLibNoThrowForKeepCallAlive","getKeepCallAliveForegroundServiceTypes","usePrevious","notifeeLib","setForegroundService","default","registerForegroundService","Promise","logger","startForegroundService","call_cid","foregroundServiceConfig","getConfig","foregroundService","title","body","android","notificationTexts","settings","getNotificationSettings","authorizationStatus","AuthorizationStatus","AUTHORIZED","channelId","channel","id","createChannel","foregroundServiceTypes","requestAnimationFrame","displayNotification","asForegroundService","ongoing","colorized","pressAction","launchActivity","isSetForegroundServiceRan","useAndroidKeepCallAliveEffect","foregroundServiceStartedRef","call","activeCallCid","cid","useCallCallingState","callingState","prevCallingState","isStartingToJoin","IDLE","JOINING","isStartingToJoinFromRinging","RINGING","isOutgoingCall","isCreatedByMe","isCallJoined","JOINED","shouldStartForegroundService","OS","run","current","notifee","displayedNotifications","getDisplayedNotifications","activeCallNotification","find","notification","stopForegroundService","cancelDisplayedNotification","then","LEFT"],"sourceRoot":"../../../src","sources":["hooks/useAndroidKeepCallAliveEffect.ts"],"mappings":"AAAA,SAASA,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAASC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,YAAY,EAAEC,SAAS,QAAQ,yBAAyB;AACjE,SACEC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OAAO,GAAG,KAAK;MAC7C,CAAC,MAAM;QACLrD,UAAU,CAACE,OAAO,CACfsD,yBAAyB,CAAC,CAAC,CAC3BM,IAAI,CAAEP,sBAAsB,IAAK;UAChC,MAAME,sBAAsB,GAAGF,sBAAsB,CAACG,IAAI,CACvDC,YAAY,IAAKA,YAAY,CAACrC,EAAE,KAAKc,aACxC,CAAC;UACD,IAAIqB,sBAAsB,EAAE;YAC1B;YACAzD,UAAU,CAACE,OAAO,CAAC0D,qBAAqB,CAAC,CAAC;UAC5C;QACF,CAAC,CAAC;MACN;IACF;EACF,CAAC,EAAE,CAACxB,aAAa,EAAEG,YAAY,EAAEW,4BAA4B,CAAC,CAAC;EAE/D3D,SAAS,CAAC,MAAM;IACd,OAAO,MAAM;MACX;MACA,IAAI2C,2BAA2B,CAACmB,OAAO,EAAE;QACvC,IAAI,CAACrD,UAAU,EAAE;QACjBA,UAAU,CAACE,OAAO,CAAC0D,qBAAqB,CAAC,CAAC;QAC1C1B,2BAA2B,CAACmB,OAAO,GAAG,KAAK;MAC7C;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC","ignoreList":[]}
|
package/dist/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.9.
|
|
1
|
+
export const version = '1.9.13';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAndroidKeepCallAliveEffect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAndroidKeepCallAliveEffect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAndroidKeepCallAliveEffect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAndroidKeepCallAliveEffect.ts"],"names":[],"mappings":"AAsEA;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,YAmGzC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.9.
|
|
1
|
+
export declare const version = "1.9.13";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -42,21 +42,26 @@ async function startForegroundService(call_cid: string) {
|
|
|
42
42
|
foregroundServiceConfig.android.channel
|
|
43
43
|
);
|
|
44
44
|
const foregroundServiceTypes = await getKeepCallAliveForegroundServiceTypes();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
// NOTE: we use requestAnimationFrame to ensure that the foreground service is started after all the current UI operations are done
|
|
46
|
+
// this is a workaround for the crash - android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground()
|
|
47
|
+
// this crash was reproducible only in some android devices
|
|
48
|
+
requestAnimationFrame(() => {
|
|
49
|
+
notifeeLib.default.displayNotification({
|
|
50
|
+
id: call_cid,
|
|
51
|
+
title,
|
|
52
|
+
body,
|
|
53
|
+
android: {
|
|
54
|
+
channelId,
|
|
55
|
+
foregroundServiceTypes,
|
|
56
|
+
asForegroundService: true,
|
|
57
|
+
ongoing: true, // user cannot dismiss the notification
|
|
58
|
+
colorized: true,
|
|
59
|
+
pressAction: {
|
|
60
|
+
id: 'default',
|
|
61
|
+
launchActivity: 'default', // open the app when the notification is pressed
|
|
62
|
+
},
|
|
58
63
|
},
|
|
59
|
-
}
|
|
64
|
+
});
|
|
60
65
|
});
|
|
61
66
|
}
|
|
62
67
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.9.
|
|
1
|
+
export const version = '1.9.13';
|