react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Application process don't stoped if this component have status Running

Open Witexp opened this issue 4 years ago • 9 comments
trafficstars

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

  1. Connect Device via usb
  2. run /android-sdk/platform-tools/adb shell
  3. use - top
  4. run the app on the device
  5. run function - BackgroundGeolocation.start();
  6. minimize the application
  7. close the application with a swipe
  8. see command output top - the application did not close

Context

Debug logs

Witexp avatar Mar 26 '21 07:03 Witexp

Read this https://github.com/darron1217/react-native-background-geolocation#android-background-service-issues

This plugin uses foreground service in Android

darron1217 avatar Mar 26 '21 07:03 darron1217

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

Witexp avatar Mar 26 '21 08:03 Witexp

Please forgive my English - google translate helps me

Witexp avatar Mar 26 '21 08:03 Witexp

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

darron1217 avatar Mar 26 '21 08:03 darron1217

Hello I updated version, but it doesn't help me. I will wait for your testing and possible solutions to the problem

Witexp avatar Mar 26 '21 14:03 Witexp

Hello. Can I still count on your help?

Witexp avatar Mar 31 '21 08:03 Witexp

Sorry but I don't have enough time to investigate into it. You can dig it yourself to find clues.

darron1217 avatar Apr 01 '21 01:04 darron1217

Could you tell me. Can I modify this component through Android Studio or do I need to use some other tools

Witexp avatar Apr 02 '21 12:04 Witexp

@Witexp You can modify it through Android Studio or whatever.

darron1217 avatar May 20 '21 00:05 darron1217