Skip to content

Commit a1f61e8

Browse files
authored
stop foreground service when app is killed (#812)
1 parent 1ccc7c5 commit a1f61e8

File tree

1 file changed

+8
-0
lines changed
  • packages/stream_video_flutter/android/src/main/kotlin/io/getstream/video/flutter/stream_video_flutter/service

1 file changed

+8
-0
lines changed

packages/stream_video_flutter/android/src/main/kotlin/io/getstream/video/flutter/stream_video_flutter/service/StreamCallService.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ open class StreamCallService : Service() {
6969
notificationPayload = NotificationPayload()
7070
}
7171

72+
override fun onTaskRemoved(rootIntent: Intent?) {
73+
super.onTaskRemoved(rootIntent)
74+
75+
// Cleanup when the app is swiped away
76+
stopForeground(true)
77+
stopSelf()
78+
}
79+
7280
override fun onBind(intent: Intent?): IBinder? = null
7381

7482
private fun startForeground() {

0 commit comments

Comments
 (0)