diff --git a/packages/stream_video_flutter/android/src/main/kotlin/io/getstream/video/flutter/stream_video_flutter/service/StreamCallService.kt b/packages/stream_video_flutter/android/src/main/kotlin/io/getstream/video/flutter/stream_video_flutter/service/StreamCallService.kt index 8489ee41b..e976ba3ca 100644 --- a/packages/stream_video_flutter/android/src/main/kotlin/io/getstream/video/flutter/stream_video_flutter/service/StreamCallService.kt +++ b/packages/stream_video_flutter/android/src/main/kotlin/io/getstream/video/flutter/stream_video_flutter/service/StreamCallService.kt @@ -69,6 +69,14 @@ open class StreamCallService : Service() { notificationPayload = NotificationPayload() } + override fun onTaskRemoved(rootIntent: Intent?) { + super.onTaskRemoved(rootIntent) + + // Cleanup when the app is swiped away + stopForeground(true) + stopSelf() + } + override fun onBind(intent: Intent?): IBinder? = null private fun startForeground() {