Coder Social home page Coder Social logo

Comments (23)

pmwisdom avatar pmwisdom commented on June 10, 2024 1

Latest commit should obliterate those pesky toast messages. I'm going to go ahead and run the plugin all day and make sure there isn't something wrong, but I haven't had a problem with it not tracking yet.

What happens if you turn detectedActivities off?

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

It should always be tracking, no matter what state your phone is in (in the background), unless you've force closed it of course.

It should restart whenever you A. Start moving again (when detected activities is activated) , and B. Move past the distance filter you've set. Once those two conditions are met it will start tracking again.

I'm going to throw up a demo later this week that you can try if your still having issues.

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

Thanks for the quick answer. Background tracking is a crucial part of a app that I'm working on which has to be live within a few month, so I'm really happy you are helping me out here. I will keep working on it later to day when I get to work, but a working example would also be great!

I'll be using it to send coords to my rest backend which then will send out push messages to devices that are within range of certain targets.

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

Still not getting the results I'm hoping for. Also I seem to get popups about activity changes even with debug: false...

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

A.K.A set useActivityDetection : false

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

Thank you. I'll try with detectedActivities off. What settings do you use? I was just using the settings from you example. Also I will update to latest to get rid of the toasts.

On my way to work (~15min walk and bus) I got 64 events (activity changes and gps coords) which my sample app sends to loggly. But only 4 was coords, the rest was activity changes....

By the way, I'm not quite sure what the desiredAccuracy and fastestInterval options does...

Just to be clear the settings I used was the aggressive ones from your example (interval 9000, fastest 5000, accuracy 20, distance 5) not the default ones from BackgroundLocationServices.js

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

Disabling debug toast works like a charm now. I would be great if you updated the plugin version when you commit changes :)

I'm seeing this when compiling
Note: D:\projects\JobOnTheRun\geo3\platforms\android\src\com\flybuy\cordova\location\BackgroundLocationUpdateService.java uses unchecked or unsafe operations.
should I worry about that?

By the way my sample app is here: https://bitbucket.org/monkeystyle/cordova-background-gps-poc/

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

For settings it depends, I usually want aggressive tracking, since its my own device. There are short descriptions of what each does in the README, but basically :

Desired Accuracy (Lower Means More Accurate) : Determines how much power the GPS gets while obtaining coordinates, which directly translates into how accurate the GPS coordinates you get back are. There is an accuracy number passed back with the location, which tells you how confident the device is that the coordinate that it sent back is where you actually are. (gps isnt 100% accurate).

Fastest Interval, which is only on android, tells the device the fastest interval that you want GPS coordinates handed back to you. Basically, how many updates your server / device wants to handle in MS. Basically you shouldn't get coordinates faster than your fastest interval.

If you want aggressive tracking, set distance : 0, desiredAccuracy : 0.

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

And no don't worry about those warnings. I'll take a look at your code and put it up in the README as a sample. Thanks!

from cordova-background-geolocation-services.

tomasmasek avatar tomasmasek commented on June 10, 2024

Hi, the plugins works great! However, I can confirm previously mentioned bug - tracking stops few seconds after the device goes to standby mode (screen off).
(tested on some Huawei ALE L21)

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

Android or iOS?

from cordova-background-geolocation-services.

tomasmasek avatar tomasmasek commented on June 10, 2024

Android! Not tested on iOS yet.

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

hmmm my test device is Huawei ALE L21 too.. maybe it's a EMUI issue?

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

@tomasmasek have you tried with useActivityDetection : false?

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

could be related: https://support.strava.com/hc/en-us/articles/216942547-How-to-fix-GPS-recording-issues-on-Huawei-Ascend-P7

from cordova-background-geolocation-services.

tomasmasek avatar tomasmasek commented on June 10, 2024

OK, got it! I had to set my demo app as "protected" in android power management settings.
Since I'm an iOS user, I didn't know about such setting in Android.
Everything works well now, but I'll keep testing and keep you updated, if there will be something new.
Thank you for help guys.

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

Cools. Let's hear how it goes, I'm still having trouble getting frequent enough updates... I need one every 2 min or so (when moving)...

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

Try these options, which are basically the most aggressive :

{
    desiredAccuracy:      0, 
    distanceFilter:       0, 
    debug:                false, 
    interval:             2000, 
    fastestInterval:      1000, 
    useActivityDetection: false 
  }

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

Super, I will try that.

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

I changed to a S5 as my test device. Everything is working perfect now! I'm getting more than enough coords. Now i just need to tweak the settings to my needs. Also I will start testing on iOS soon. Any chance of a WP version of the plugin?

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

@icedice no plan for Windows Phone support since I don't have any test devices.

Glad you got the S5 working though!

from cordova-background-geolocation-services.

icedice avatar icedice commented on June 10, 2024

Too bad :( I'm going to need WP support very soon. I might just port your plugin to WP if i got the skills :)

from cordova-background-geolocation-services.

pmwisdom avatar pmwisdom commented on June 10, 2024

Awesome, let me know if you start that up and i'll help in any way I can.

from cordova-background-geolocation-services.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.