react-native-music-control
react-native-music-control copied to clipboard
MusicControl.enableControl() keeps app running even if I close it.
Description
MusicControl.enableControl() makes app keep running even if I completely close it. Normally even if I use BackgroundTimer, the interval will stop after I completely close the app from the Android menu. If I execute MusicControl.enableControl() in componentDidMount, the app keeps running even I close it.
MusicControl.enableControl('play', false); or MusicControl.stopControl(); doesn't help, app keeps still running.
Note: this happens even If I completely remove BackgroundTimer so this is not a BackgroundTimer issue.
- Sample code (provide repo url or sample code)
import MusicControl from 'react-native-music-control';
import BackgroundTimer from 'react-native-background-timer';
componentDidMount() {
let i = 0;
BackgroundTimer.setInterval(() => {console.log(i); i++;}, 1000);
MusicControl.enableControl('play', true);
}
componentWillUnmount() {
MusicControl.enableControl('play', false);
MusicControl.stopControl()
}
-
Platform ?
- [ ] iOS
- [x] Android
- Device
- [x] Simulator
- [x] Real device
Same issue here, the redux data is not cleared after closing the app.
Same here, it causes the playing audio in the app continue to play ever after the app is closed in Android. Any update on this and way to fix it? Any suggestions appreciated!
Is there a way to stop playing the audio when the App get closed?
++