transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.65k stars 426 forks source link

getCurrentPosition with error 100 #33

Closed twelvearrays closed 8 years ago

twelvearrays commented 8 years ago

I have an iPhone 5 with No service I am using to test my app along with several beta tester with iPhone 5s. I do not receive an failure callback in the designated timeout. I do however receive an error 100 randomly after this call anywhere between 1 minute and up to 8 minutes usually till indefinitely. I have also written another simple location library that gets the current location of the device and that works. Meaning that the GPS does have a current location. Seems like the timeout for the error 100 isn't timing out?

BackgroundGeolocation.getCurrentPosition({ persist: true, timeout: 10, // 30 second timeout to fetch location maximumAge: 5000, // Accept the last-known-location if not older than 5000 ms. minimumAccuracy: 50, // Fetch a location with a minimum accuracy of 10 meters. }, function(location) { // This location is already persisted to plugin’s SQLite db. // If you’ve configured #autoSync: true, the HTTP POST has already started. console.log('- Current position received: ', location); }, function(errorCode) { alert('An location error occurred: ' + errorCode + ' '); });

christocracy commented 8 years ago

https://github.com/transistorsoft/react-native-background-geolocation/wiki/Error-Codes

I'm getting rid of the minimimAccuracy filtering

On Tuesday, November 24, 2015, twelvearrays notifications@github.com wrote:

I have an iPhone 5 with No service I am using to test my app along with several beta tester with iPhone 5s. I do not receive an failure callback in the designated timeout. I do however receive an error 100 randomly after this call anywhere between 1 minute and up to 8 minutes usually till indefinitely. I have also written another simple location library that gets the current location of the device and that works. Meaning that the GPS does have a current location. Seems like the timeout for the error 100 isn't timing out?

BackgroundGeolocation.getCurrentPosition({ persist: true, timeout: 10, // 30 second timeout to fetch location maximumAge: 5000, // Accept the last-known-location if not older than 5000 ms. minimumAccuracy: 50, // Fetch a location with a minimum accuracy of 10 meters. }, function(location) { // This location is already persisted to plugin’s SQLite db. // If you’ve configured #autoSync: true, the HTTP POST has already started. console.log('- Current position received: ', location); }, function(errorCode) { alert('An location error occurred: ' + errorCode + ' '); });

— Reply to this email directly or view it on GitHub https://github.com/transistorsoft/react-native-background-geolocation/issues/33 .

Snet form Gmail Mobile

christocracy commented 8 years ago

Get rid of your minimumAccuracy

On Tuesday, November 24, 2015, twelvearrays notifications@github.com wrote:

I have an iPhone 5 with No service I am using to test my app along with several beta tester with iPhone 5s. I do not receive an failure callback in the designated timeout. I do however receive an error 100 randomly after this call anywhere between 1 minute and up to 8 minutes usually till indefinitely. I have also written another simple location library that gets the current location of the device and that works. Meaning that the GPS does have a current location. Seems like the timeout for the error 100 isn't timing out?

BackgroundGeolocation.getCurrentPosition({ persist: true, timeout: 10, // 30 second timeout to fetch location maximumAge: 5000, // Accept the last-known-location if not older than 5000 ms. minimumAccuracy: 50, // Fetch a location with a minimum accuracy of 10 meters. }, function(location) { // This location is already persisted to plugin’s SQLite db. // If you’ve configured #autoSync: true, the HTTP POST has already started. console.log('- Current position received: ', location); }, function(errorCode) { alert('An location error occurred: ' + errorCode + ' '); });

— Reply to this email directly or view it on GitHub https://github.com/transistorsoft/react-native-background-geolocation/issues/33 .

Snet form Gmail Mobile

twelvearrays commented 8 years ago

Let me know when you have an update with this removed. Be happy to test. As always thanks for the quick response!

christocracy commented 8 years ago

Probably tonight

On Tuesday, November 24, 2015, twelvearrays notifications@github.com wrote:

Let me know when you have an update with this removed. Be happy to test. As always thanks for the quick response!

— Reply to this email directly or view it on GitHub https://github.com/transistorsoft/react-native-background-geolocation/issues/33#issuecomment-159450528 .

Snet form Gmail Mobile

twelvearrays commented 8 years ago

I have noticed turning my wifi on or off forces the getCurrentPosition call to complete and return successfully.

christocracy commented 8 years ago

You definitely want to keep Wifi ON when attempting to track a user's position. Native geolocation (on any platform; iOS, Android) aggregates 3 sources together to achieve the best possible accuracy.

On Wed, Nov 25, 2015 at 9:20 AM, twelvearrays notifications@github.com wrote:

I have noticed turning my wifi on or off forces the getCurrentPosition call to complete and return successfully.

— Reply to this email directly or view it on GitHub https://github.com/transistorsoft/react-native-background-geolocation/issues/33#issuecomment-159620221 .

Chris Scott Transistor Software http://www.transistorsoft.com

twelvearrays commented 8 years ago

Good to know! I will put a check in my code if wifi is enabled. Still get the weird timeout times with error 100 though even with wifi on. Thanks for the insight.

christocracy commented 8 years ago

The library currently throws out any received location having accuracy >

  1. When it sees a low-accuracy location like this, it fires the error code 100.

This merely means you're receiving poor-accuracy locations. When I post the latest version, you'll no longer see error code 100 -- you'll see really poor accuracy locations instead.

On Wed, Nov 25, 2015 at 9:39 AM, twelvearrays notifications@github.com wrote:

Good to know! I will put a check in my code if wifi is enabled. Still get the weird timeout times with error 100 though even with wifi on. Thanks for the insight.

— Reply to this email directly or view it on GitHub https://github.com/transistorsoft/react-native-background-geolocation/issues/33#issuecomment-159625768 .

Chris Scott Transistor Software http://www.transistorsoft.com

twelvearrays commented 8 years ago

Ok sounds good! Look forward to the update.

christocracy commented 8 years ago

Try out my new Android Demo App

twelvearrays commented 8 years ago

Did 0.1.2 get rid of minimumAccuracy?

christocracy commented 8 years ago

yes

On Fri, Nov 27, 2015 at 11:59 AM, twelvearrays notifications@github.com wrote:

Did 0.1.2 get rid of minimumAccuracy?

— Reply to this email directly or view it on GitHub https://github.com/transistorsoft/react-native-background-geolocation/issues/33#issuecomment-160175514 .

Chris Scott Transistor Software http://www.transistorsoft.com

twelvearrays commented 8 years ago

Awesome! As always, great work and fast response! Thanks