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

Forground and background issues in API 31-32 Android 12 emulator #765

Open
pouriamoosavi opened this issue Mar 10, 2022 · 1 comment
Open

Comments

@pouriamoosavi
Copy link

pouriamoosavi commented Mar 10, 2022

Your Environment

  • Plugin version: 3.1.0
  • Platform: Android
  • OS version: 12 API 31 and 32
  • Device manufacturer and model: Pixel 3a
  • Running in Simulator: Yes
  • Cordova version (cordova -v): No cordova. Ionic/angular 6, Capacitor 3.3.4
  • Cordova platform version (cordova platform ls):
  • Plugin configuration options: Default configuration or:
desiredAccuracy: 0,
locationProvider: BackgroundGeolocationLocationProvider.RAW_PROVIDER,
stationaryRadius: 50,
distanceFilter: 50,
notificationTitle: 'nn',
notificationText: "" ,
debug: false,
startOnBoot: false,
stopOnTerminate: false,
interval: 10000,
fastestInterval: 5000,
activitiesInterval: 10000,
stopOnStillActivity: false,
startForeground: true,
url: "nn",
httpHeaders: {
  authorization: "nn",
},
postTemplate: {
  lat: '@latitude',
  lng: '@longitude',
  spd: '@speed',
  brn: '@bearing',
  acr: '@accuracy',
  tm: '@time',
}

  • Link to your project: Not public

Context

on("location") and getCurrentLocation don't work. Calling getCurrentLocation with timeout works though. Maybe there is a timeout issue in default location tracking that does not fire. Also in case of adding post url, nothing happened and no request is made. All access have been granted and even the notification is showing.

New updates:

getCurrentLocation works with enableHighAccuracy but it has about 5 seconds delay. Auto update and background still does not work.

Expected Behavior

Work as it works on android 11 and lower.

Actual Behavior

Does nothing. Even getCurrentLocation does not work until specifying timeout

Possible Fix

Maybe there is a timeout in default config that has a problem?

Steps to Reproduce

  1. Install library on Ionic 6 application.
  2. Get access to coarse and fine locations and then background location.
  3. Call start
  4. Nothing happens!
  5. Call getCurrentLocation
  6. Nothing happens!
  7. Call getCurrentLocation({timeout:1000})
  8. Returns location

Context

My application uses background location

Debug logs

@pouriamoosavi pouriamoosavi changed the title Forground and background issues in API 31 Android 12 and above Forground and background issues in API 31 Android 12 emulator Mar 13, 2022
@pouriamoosavi pouriamoosavi changed the title Forground and background issues in API 31 Android 12 emulator Forground and background issues in API 31-32 Android 12 emulator Mar 13, 2022
@rafaelveraGGI
Copy link

Hi, on 05.10.2022 I have seen the same error on the emulator. Some people have clone this repository and seems that they fixed it by using another plugin (f.e. https://github.com/HaylLtd/cordova-background-geolocation-plugin/) as seen in issue #770. But it would be nice if this one actually gets fixed.

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