react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Application process don't stoped if this component have status Running
Your Environment
- Plugin version: 0.6.3
- Platform: Android
- OS version: Android 10
- Device manufacturer and model: Honor 10Lite
- React Native version: 0.63.2
- Plugin configuration options:
BackgroundGeolocation.configure({
desiredAccuracy: BackgroundGeolocation.LOW_ACCURACY,
stationaryRadius: 50,
distanceFilter: 50,
notificationTitle: 'Background tracking',
notificationText: 'enabled',
debug: false,
startOnBoot: false,
stopOnTerminate: true,
locationProvider: BackgroundGeolocation.ACTIVITY_PROVIDER,
interval: 10000,
fastestInterval: 5000,
activitiesInterval: 10000,
stopOnStillActivity: false,
startForeground: true,
url:
https://back-gpsgeo-default-rtdb.firebaseio.com/test.json, syncUrl:https://back-gpsgeo-default-rtdb.firebaseio.com/test.json, syncThreshold: 10, httpHeaders: { 'X-FOO': 'bar' }, // customize post properties postTemplate: { time: '@time', lat: '@latitude', lon: '@longitude', //foo: 'bar' // you can also add your own properties } });
Context
(I asked this question in mauron85/react-native-background-geolocation, then tried your component and see the same problem ) I wanted to use the @ darron1217 / react-native-background-geolocation component for Geo traking, but I noticed this situation - if you give a signal to start the component (BackgroundGeolocation.start ();), and then minimize and then swipe to close the application, then the application is like that remains hanging in memory (this can be seen through the adb shell - using the top command). I'm using BackgroundGeolocation.removeAllListeners (); in componentWillUnmount but it doesn't help
Expected Behavior
Actual Behavior
Possible Fix
Steps to Reproduce
- Connect Device via usb
- run /android-sdk/platform-tools/adb shell
- use - top
- run the app on the device
- run function - BackgroundGeolocation.start();
- minimize the application
- close the application with a swipe
- see command output top - the application did not close
Context
Debug logs
Read this https://github.com/darron1217/react-native-background-geolocation#android-background-service-issues
This plugin uses foreground service in Android
It doesn't help me. I have a very heavy application that uses react-native-geolocation-service (Geolocation.watchPosition) when starting the application. If I run the @ darron1217 / react-native-background-geolocation component and minimize the application, then it unfolds without problems. If I stop the component (BackgroundGeolocation.stop ()) and then minimize and close it with a swipe, the application starts normally. BUT - if I start the component (BackgroundGeolocation.start ()) and then minimize and close with a swipe - the application does not start I watched how the application activity is displayed through - adb shell - top - and noticed that the application, if there was a command BackgroundGeolocation.start () and then destruction with a swipe, still hangs in the phone's memory, although stopOnTerminate is set to true, BUT if, before destroying the application with a swipe, do BackgroundGeolocation.stop (); - the application exits normally and you can see it in - adb shell - top
Please forgive my English - google translate helps me
The latest version is 0.6.6 please update it and try it again.
I guess you have some problem with stopOnTerminate: true option. But I don't have enough time to test it.
I'll take a look at it later
Hello I updated version, but it doesn't help me. I will wait for your testing and possible solutions to the problem
Hello. Can I still count on your help?
Sorry but I don't have enough time to investigate into it. You can dig it yourself to find clues.
Could you tell me. Can I modify this component through Android Studio or do I need to use some other tools
@Witexp You can modify it through Android Studio or whatever.