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,