# Can't stop the stream when app is killed

**URL:** <https://react-native-webrtc.discourse.group/t/cant-stop-the-stream-when-app-is-killed/1123>\
**Category:** Help\
**Created:** [January 28, 2021, 4:15pm UTC](https://react-native-webrtc.discourse.group/t/cant-stop-the-stream-when-app-is-killed/1123 "2021-01-28T16:15:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilya-lopukhin](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/ilya-lopukhin/32/350_2.png) [@ilya-lopukhin](https://react-native-webrtc.discourse.group/u/ilya-lopukhin)\
**Post date:** [January 28, 2021, 4:15pm UTC](https://react-native-webrtc.discourse.group/t/cant-stop-the-stream-when-app-is-killed/1123/1 "2021-01-28T16:15:36Z")

</div>

So guys, i’m a bit desperate here: i’m using react-native-foreground-notification together with react-native-webrtc. The problem is i need to stop it when i swipe the app from the multitasking. On android \<= 7 it stops. On higher androids it just keeps going forever. I tried forking the fg-notification package and implementing the `onTaskRemoved()` . I tried `onDestroy()` . I tried declaring `android:stopWithTask="true"`.  
What i achieved is service being kinda “stopped”, notification removed, but the darn stream is still going. So no notification, no clue app is running or something, but the webrtc stream is still perfectly fine. This drives me crazy, any thoughts what i can do?  
Without react-native-foreground-service at all the whole thing is closing naturally when i kill the app obviously.

---

<div class="post-metadata">

**Author:** ![ilya-lopukhin](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/ilya-lopukhin/32/350_2.png) [@ilya-lopukhin](https://react-native-webrtc.discourse.group/u/ilya-lopukhin)\
**Post date:** [January 28, 2021, 4:40pm UTC](https://react-native-webrtc.discourse.group/t/cant-stop-the-stream-when-app-is-killed/1123/2 "2021-01-28T16:40:37Z")

</div>

So guys to sum up:  
On Android, i have an ability to KEEP LISTENING to the microphone and streaming audio even after killing the app. I can do this without ANY INDICATION something is running. No notification. App is not in the multitasking. Mic is being recorded. I just find this so BIZARRE from a privacy standpoint. I can do a mic spying app right now and it will run silently without user even noticing it even after he swipes my spy app from the multitasking. Can anyone explain to me what’s happening here? Should i contact any Android maintainers about this?

---

<div class="post-metadata">

**Author:** ![Mit-rudani](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/mit-rudani/32/885_2.png) [@Mit-rudani](https://react-native-webrtc.discourse.group/u/Mit-rudani)\
**Post date:** [June 4, 2025, 9:07am UTC](https://react-native-webrtc.discourse.group/t/cant-stop-the-stream-when-app-is-killed/1123/3 "2025-06-04T09:07:05Z")

</div>

hello @ilya-lopukhin

please share how to manage audio in kill mode
