voximplant / react-native-foreground-service

React native module to start foreground service on android
MIT License
159 stars 91 forks source link

Service doesn't stop after closing the app #52

Open n-ii-ma opened 2 years ago

n-ii-ma commented 2 years ago

I'm using this package with react-native-geolocation-service to track location similar to their example with the exception of starting the service in useEffect.

The problem is that the foreground service never stops when the app is closed since the return function of the useEffect which stops the service is never called.

Is there any way for this package to stop its service after the app is fully closed?

pb-biswanatha-tewari commented 1 year ago

@n-ii-ma did you find any solution for the same? am stuck with a similar problem

eisodev commented 1 year ago

Hey!

@n-ii-ma How do you verify that the service is still running? Would like to check this also because I'm only doing active tracking while on a specific screen.

For me the foreground service notification gets closed (at least on Pixel 5 API 33 emulator, package version 3.0.2, react-native 0.68.5) whenever I close the app manually.