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

Background service dies when opening another activity and then navigating back #122

Open
FranciZ opened this issue Aug 8, 2018 · 4 comments

Comments

@FranciZ
Copy link

FranciZ commented Aug 8, 2018

Your Environment

  • Plugin version: 1.8.0
  • Platform: Anrdoid
  • OS version: 8.1
  • Device manufacturer / model: Pixel XL 2
  • Nativescript version (tns info):
    ✔ Getting NativeScript components versions information...
    ⚠ Update available for component nativescript. Your current version is 4.1.2 and the latest available version is 4.2.0.
    ✔ Component tns-core-modules has 4.2.0 version and is up to date.
    ✔ Component tns-android has 4.2.0 version and is up to date.
  • Plugin config
{
        debug: false,
        desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
        stationaryRadius: 25,
        distanceFilter: 50,
        activityRecognitionInterval: 10000,
        notificationText: 'Loco service activated',
        notificationIcon: 'drawable/ic_notification',
        url: `${config.API_HOST}/v1/game/${this.rootStore.game._id}/player/${this.rootStore.game.gamePlayerId}/location`
      }

Expected Behavior

When opening another activity and navigating back to the NativeScript app activity the background service should remain working.

Actual Behavior

Navigating back kills the geolocation background service. The BackgroundGeolocation.getState returns enabled:true but location is not being reported anymore.

Steps to Reproduce

You can use PhotoViewer plugin to open a photo in a new activity and then navigate back.

Debug logs

Nothing unusual in the logs.

@caiusCitiriga
Copy link

Don't know if you still are interested in this, but maybe to someone might interest:
A possible temporary fix might be to force the reset: true when initializing the conf? So it won't care to see the service as alive or not, it will start it anyway... (?)

@christocracy
Copy link
Member

I don’t see how reset:true would help here.

@caiusCitiriga
Copy link

caiusCitiriga commented Jan 19, 2019

well, I'm assuming that the main activity on which he "lands back" from the navigation would run the initialization method on the plugin. If I didn't get anything wrong.

@christocracy
Copy link
Member

Can someone share with me a simple test-case app?

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

3 participants