From c22d24f0331eaba11eb5403d15c01fbb6ba0221f Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 2 Apr 2026 16:23:44 +0200 Subject: [PATCH 1/3] fix: avoid notifee check for callalive if there is callingx --- .../src/hooks/useAndroidKeepCallAliveEffect.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts b/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts index ff14bc52b7..1b3ddd4b09 100644 --- a/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts +++ b/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts @@ -81,7 +81,7 @@ async function startForegroundService(call_cid: string) { * This hook is used to keep the call alive in the background for Android. * It starts a foreground service to keep the call alive as soon as the call is joined * and stops the foreground Service when the call is left. - * Additionally: also responsible for cancelling any notifee displayed notification when the call has transitioned out of ringing + * Additionally (if not using callingx): also responsible for cancelling any notifee displayed notification when the call has transitioned out of ringing */ export const useAndroidKeepCallAliveEffect = () => { const foregroundServiceStartedRef = useRef(false); @@ -112,6 +112,7 @@ export const useAndroidKeepCallAliveEffect = () => { ) { return undefined; } + const isCallingxUsed = !!callingx?.isSetup; // start foreground service as soon as the call is joined if (shouldStartForegroundService) { @@ -121,7 +122,7 @@ export const useAndroidKeepCallAliveEffect = () => { } // Optional compatibility cleanup: if the app uses Notifee for ringing push, // we might have an incoming call notification running as a foreground service. - if (notifeeLib) { + if (!isCallingxUsed && notifeeLib) { const notifee = notifeeLib.default; const displayedNotifications = await notifee.getDisplayedNotifications(); @@ -159,7 +160,7 @@ export const useAndroidKeepCallAliveEffect = () => { return () => { // cancel any notifee displayed notification when the call has transitioned out of ringing // NOTE: cancels only the non fg service notifications - if (notifeeLib) { + if (!isCallingxUsed && notifeeLib) { notifeeLib.default.cancelDisplayedNotification(activeCallCid); } }; @@ -173,7 +174,7 @@ export const useAndroidKeepCallAliveEffect = () => { stopForegroundServiceNoThrow(); foregroundServiceStartedRef.current = false; } else { - if (notifeeLib) { + if (!isCallingxUsed && notifeeLib) { notifeeLib.default .getDisplayedNotifications() .then((displayedNotifications) => { From 6857d3e44ecb0ba7390cf918e3a9229a9d068dde Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 2 Apr 2026 16:42:27 +0200 Subject: [PATCH 2/3] Revert "fix: avoid notifee check for callalive if there is callingx" This reverts commit c22d24f0331eaba11eb5403d15c01fbb6ba0221f. --- .../src/hooks/useAndroidKeepCallAliveEffect.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts b/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts index 1b3ddd4b09..ff14bc52b7 100644 --- a/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts +++ b/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts @@ -81,7 +81,7 @@ async function startForegroundService(call_cid: string) { * This hook is used to keep the call alive in the background for Android. * It starts a foreground service to keep the call alive as soon as the call is joined * and stops the foreground Service when the call is left. - * Additionally (if not using callingx): also responsible for cancelling any notifee displayed notification when the call has transitioned out of ringing + * Additionally: also responsible for cancelling any notifee displayed notification when the call has transitioned out of ringing */ export const useAndroidKeepCallAliveEffect = () => { const foregroundServiceStartedRef = useRef(false); @@ -112,7 +112,6 @@ export const useAndroidKeepCallAliveEffect = () => { ) { return undefined; } - const isCallingxUsed = !!callingx?.isSetup; // start foreground service as soon as the call is joined if (shouldStartForegroundService) { @@ -122,7 +121,7 @@ export const useAndroidKeepCallAliveEffect = () => { } // Optional compatibility cleanup: if the app uses Notifee for ringing push, // we might have an incoming call notification running as a foreground service. - if (!isCallingxUsed && notifeeLib) { + if (notifeeLib) { const notifee = notifeeLib.default; const displayedNotifications = await notifee.getDisplayedNotifications(); @@ -160,7 +159,7 @@ export const useAndroidKeepCallAliveEffect = () => { return () => { // cancel any notifee displayed notification when the call has transitioned out of ringing // NOTE: cancels only the non fg service notifications - if (!isCallingxUsed && notifeeLib) { + if (notifeeLib) { notifeeLib.default.cancelDisplayedNotification(activeCallCid); } }; @@ -174,7 +173,7 @@ export const useAndroidKeepCallAliveEffect = () => { stopForegroundServiceNoThrow(); foregroundServiceStartedRef.current = false; } else { - if (!isCallingxUsed && notifeeLib) { + if (notifeeLib) { notifeeLib.default .getDisplayedNotifications() .then((displayedNotifications) => { From 7314926427e54d6c8cb6ea607efd43fd9e79a0c7 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 2 Apr 2026 16:53:04 +0200 Subject: [PATCH 3/3] completely remove notifee remnants --- .../hooks/useAndroidKeepCallAliveEffect.ts | 40 ------------------- .../src/utils/StreamVideoRN/index.ts | 2 +- .../src/utils/push/libs/notifee/index.ts | 4 -- 3 files changed, 1 insertion(+), 45 deletions(-) diff --git a/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts b/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts index ff14bc52b7..0ec2087253 100644 --- a/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts +++ b/packages/react-native-sdk/src/hooks/useAndroidKeepCallAliveEffect.ts @@ -10,11 +10,8 @@ import { } from 'react-native'; import { CallingState, videoLoggerSystem } from '@stream-io/video-client'; import { keepCallAliveCallRef } from '../utils/keepCallAliveHeadlessTask'; -import { getNotifeeLibNoThrowForKeepCallAlive } from '../utils/push/libs/notifee'; import { getCallingxLibIfAvailable } from '../utils/push/libs'; -const notifeeLib = getNotifeeLibNoThrowForKeepCallAlive(); - async function stopForegroundServiceNoThrow() { const logger = videoLoggerSystem.getLogger('stopForegroundServiceNoThrow'); try { @@ -119,21 +116,6 @@ export const useAndroidKeepCallAliveEffect = () => { if (foregroundServiceStartedRef.current) { return; } - // Optional compatibility cleanup: if the app uses Notifee for ringing push, - // we might have an incoming call notification running as a foreground service. - if (notifeeLib) { - const notifee = notifeeLib.default; - const displayedNotifications = - await notifee.getDisplayedNotifications(); - const activeCallNotification = displayedNotifications.find( - (notification) => notification.id === activeCallCid, - ); - if (activeCallNotification) { - // this means that we have a incoming call notification shown as foreground service and we must stop it - notifee.stopForegroundService(); - notifee.cancelDisplayedNotification(activeCallCid); - } - } await startForegroundService(activeCallCid); foregroundServiceStartedRef.current = true; @@ -155,14 +137,6 @@ export const useAndroidKeepCallAliveEffect = () => { return () => { sub.remove(); }; - } else if (callingState === CallingState.RINGING) { - return () => { - // cancel any notifee displayed notification when the call has transitioned out of ringing - // NOTE: cancels only the non fg service notifications - if (notifeeLib) { - notifeeLib.default.cancelDisplayedNotification(activeCallCid); - } - }; } else if ( callingState === CallingState.IDLE || callingState === CallingState.LEFT @@ -172,20 +146,6 @@ export const useAndroidKeepCallAliveEffect = () => { // stop foreground service when the call is not active stopForegroundServiceNoThrow(); foregroundServiceStartedRef.current = false; - } else { - if (notifeeLib) { - notifeeLib.default - .getDisplayedNotifications() - .then((displayedNotifications) => { - const activeCallNotification = displayedNotifications.find( - (notification) => notification.id === activeCallCid, - ); - if (activeCallNotification) { - // this means that we have a incoming call notification shown as foreground service and we must stop it - notifeeLib.default.stopForegroundService(); - } - }); - } } } return undefined; diff --git a/packages/react-native-sdk/src/utils/StreamVideoRN/index.ts b/packages/react-native-sdk/src/utils/StreamVideoRN/index.ts index 70378bb495..f2a7e5f6ee 100644 --- a/packages/react-native-sdk/src/utils/StreamVideoRN/index.ts +++ b/packages/react-native-sdk/src/utils/StreamVideoRN/index.ts @@ -131,7 +131,7 @@ export class StreamVideoRN { callingx.setup(options); } catch { throw new Error( - 'react-native-callingx library is not installed. Please check the installation instructions: https://getstream.io/video/docs/react-native/incoming-calls/ringing-setup/react-native/.', + 'react-native-callingx library is not installed. Please check our migration instructions: https://getstream.io/video/docs/react-native/migration-guides/1.32.0/.', ); } diff --git a/packages/react-native-sdk/src/utils/push/libs/notifee/index.ts b/packages/react-native-sdk/src/utils/push/libs/notifee/index.ts index caec390eb9..e867904733 100644 --- a/packages/react-native-sdk/src/utils/push/libs/notifee/index.ts +++ b/packages/react-native-sdk/src/utils/push/libs/notifee/index.ts @@ -33,10 +33,6 @@ export function getNotifeeLibThrowIfNotInstalledForPush() { return lib; } -export function getNotifeeLibNoThrowForKeepCallAlive() { - return lib; -} - export function getIncomingCallForegroundServiceTypes() { const types: AndroidForegroundServiceType[] = [ AndroidForegroundServiceType.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE,