Skip to content

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

@FranciZ

Description

@FranciZ

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions