voximplant / react-native-foreground-service

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

Kill on destroy #25

Open mattveraldi opened 4 years ago

mattveraldi commented 4 years ago

Hi, I needed to add this behaviour to my react-native app, so I implemented this notificationConfig. Feel free to merge it if you think it's useful. Best regards.

hazelf42 commented 3 years ago

+1 would like this added

esinanturan commented 3 years ago

@mattveraldi It's killing the notification but when I checked the app status on the app info it seems app still working in the background and the option 'force stop' is available. And I checked it starting the service causing this without foreground service when I kill the app there is no 'force stop' option available. I think it's not exactly killing the service. I had to add

android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);

to the onHostDestroy method of the module