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

BackgroundLocation.getLocationUpdates when phone is locked #160

Closed
jaca420 opened this issue Jun 30, 2022 · 4 comments
Closed

BackgroundLocation.getLocationUpdates when phone is locked #160

jaca420 opened this issue Jun 30, 2022 · 4 comments
Assignees

Comments

@jaca420
Copy link

jaca420 commented Jun 30, 2022

My app writes to Firestore when location changes. I was testing it with app open and everything is ok. But when I lock my phone and leave the app open, I still see the notification "Background service is running" but nothing is written to the database.
Does this not work with phone locked?

      await BackgroundLocation.startLocationService(distanceFilter: 30);

      BackgroundLocation.getLocationUpdates((location) {
        setState(() {
          latitude = location.latitude.toString();
          longitude = location.longitude.toString();
          accuracy = location.accuracy.toString();
          altitude = location.altitude.toString();
          bearing = location.bearing.toString();
          speed = location.speed.toString();
        });

        processLocation(location);
      });

processLocation is just creating the database object and setting it.

@MoralCode
Copy link
Collaborator

if you put a print statement in or after the setState call, do you get it printing output? i.e. is it just the database part not working? or are you not getting any background location updates at all?

@Almoullim
Copy link
Owner

fixed in 52ef3db version 0.12.0

@Almoullim Almoullim self-assigned this Jul 25, 2023
@MoralCode
Copy link
Collaborator

@Almoullim is this related to notification importance? the original PR said "I still see the notification "Background service is running"", which made me think it was more likely related to firestore

@Almoullim
Copy link
Owner

Almoullim commented Jul 26, 2023

@MoralCode if it's not fixed as part of the notifcation importance then it would be related to one of these two issues: #139 #131 either way this issue is old and I doubt we'd hear back from the issue author to know more details so its best to close and focus on the other two. Please let me know if you think otherwise, maybe I'm missing something.

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