I've tried all variations of setCategory and the sound just won't stop when the app is minimized on both iOS and Android. One can use AppState to pause it manually but I'm wondering if there is a sound category that will prevent the sound from playing when the app is minimized?
This issue is a bit old now but for anyone passing by you can use Appstate to determine if the app is suspended and stop the music that way:
componentDidMount() {
AppState.addEventListener('change', (state) => {
if(state === 'background'){
this.mainMusic.stop()
}
})
}
Most helpful comment
This issue is a bit old now but for anyone passing by you can use Appstate to determine if the app is suspended and stop the music that way: