react-native-track-player version 1.1.8
Using example app from this repo.
On Android, launch the example app.
Use the following command to verify the app is running. A pid number will be given.
adb shell pidof com.example
Do not go past the initial screen of the demo UI.
Quit the app by swiping it away in the multi-tasking / recent apps menu.
Use the same command to check again. The process no longer exists, as expected.
Launch the app again, and verify a new process ID exists.
This time, proceed to the playlist example and start playing a track.
Quit the app again.
Check the process again.
This time, even though the playback has stopped, and the app does not appear in the recent apps menu, the process still exists.
This circumstance is leading to strange behavior in my app because my redux store remains intact at this point, even though both the main activity and the music service have been destroyed. When the app is re-launched, my redux store exists as it did when the app was "quit", however, the activity is re-created, and so is the music service.
Is there some configuration that can be changed so that the process fully quits as would seem intuitive?
I am using stopWithApp: true in my app, just like the example. So, that further underscores the expectation that once the app is "quit" it shouldn't exist at all.
possibly related to: https://github.com/react-native-kit/react-native-track-player/issues/732
I thought it might be related to https://github.com/react-native-kit/react-native-track-player/pull/714, but even after this change, the same behavior occurs.
fixed?
same issue here
For those wondering, my current workaround for this is to watch for a certain component to unmount, which will only happen when the app is closed in this manner. If this occurs, I reset applicable portions of my redux state. When the app is re-opened, even though the JS context is still the same, the main component is remounted and my app re-starts as expected.
Most helpful comment
For those wondering, my current workaround for this is to watch for a certain component to unmount, which will only happen when the app is closed in this manner. If this occurs, I reset applicable portions of my redux state. When the app is re-opened, even though the JS context is still the same, the main component is remounted and my app re-starts as expected.