Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

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

Open
3 of 4 tasks
paulik123 opened this issue Nov 11, 2020 · 4 comments
Open
3 of 4 tasks

Comments

@paulik123
Copy link

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
    • Android
  1. Device
  • Simulator
  • Real device
@tuandinh0801
Copy link

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

@jhclaura
Copy link

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!

@jcalvezar
Copy link

jcalvezar commented May 5, 2022

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

@JavoxirNazarov
Copy link

++

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants