Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Witexp opened this issue Mar 26, 2021 · 9 comments
Open

Comments

@Witexp
Copy link

Witexp commented Mar 26, 2021

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

@darron1217
Copy link
Owner

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

This plugin uses foreground service in Android

@Witexp
Copy link
Author

Witexp commented Mar 26, 2021

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
Copy link
Author

Witexp commented Mar 26, 2021

Please forgive my English - google translate helps me

@darron1217
Copy link
Owner

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

@Witexp
Copy link
Author

Witexp commented Mar 26, 2021

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

@Witexp
Copy link
Author

Witexp commented Mar 31, 2021

Hello. Can I still count on your help?

@darron1217
Copy link
Owner

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

@Witexp
Copy link
Author

Witexp commented Apr 2, 2021

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

@darron1217
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants