react-native-music-control icon indicating copy to clipboard operation
react-native-music-control copied to clipboard

MusicControl.enableControl() keeps app running even if I close it.

Open paulik123 opened this issue 4 years ago • 4 comments

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.

  1. 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()
}
  1. Platform ?

    • [ ] iOS
    • [x] Android
  1. Device
  • [x] Simulator
  • [x] Real device

paulik123 avatar Nov 11 '20 13:11 paulik123

Same issue here, the redux data is not cleared after closing the app.

tuandinh0801 avatar Dec 13 '20 10:12 tuandinh0801

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!

jhclaura avatar Jul 15 '21 17:07 jhclaura

Is there a way to stop playing the audio when the App get closed?

jcalvezar avatar May 05 '22 21:05 jcalvezar

++

JavoxirNazarov avatar Jun 14 '22 12:06 JavoxirNazarov