jamesmontemagno / GeolocatorPlugin

Geolocation plugin for Xamarin and Windows
MIT License
294 stars 158 forks source link

Speed not available on AT&T #262

Closed netzombieBKW closed 6 years ago

netzombieBKW commented 6 years ago

Bug Information

Several customers reported issues with our drive application. The only thing we found in common was they were all AT&T wireless. We tested this same app local office on three iPhone X's with Verizon Wireless and one with T-Mobile and they work perfectly. On the two AT&T iPhones X's here in the local office it's the same as our customers report. It's recording all position changes except the speed is always zero.

Version Number of Plugin: 4.5.0.6 Device Tested On: iPhoneX, iPhone 6s Simulator Tested On: N/A Version of VS: 7.5.3 (Build 7) Version of Xamarin: 4.4.1.193 Versions of other things you are using: N/A

Steps to reproduce the Behavior

StartListeningAsync using Xamarin Geolocator

Expected Behavior

Returns Latitude, Longitude, and Speed as device is moved

Actual Behavior

Latitude & Longitude are returned with no speed

Code snippet

if (await CrossGeolocator.Current.StartListeningAsync(TimeSpan.FromSeconds(5), 10,
               true, new ListenerSettings
               {
                   ActivityType = ActivityType.AutomotiveNavigation,
                   AllowBackgroundUpdates = true,
                   DeferLocationUpdates = false,
                   DeferralDistanceMeters = null,
                   DeferralTime = null,
                   ListenForSignificantChanges = false,

                   PauseLocationUpdatesAutomatically = false
               }))
            {
                if (Helpers.Settings.IsSupportMode)
                {
                    _startTime = DateTime.Now;
                    Common.Log("Drive Start Listening", (int)(DateTime.Now - _startTime).TotalMilliseconds, Helpers.Settings.IsSupportMode);
                }
                IsTracking = true;
                TestDriveStatus = Common.LiveDriveStatus.HomeBase;
                StartDrive();
            }

void Geolocator_PositionChanged(object sender, PositionEventArgs e) { var position = e.Position; Speed = position.Speed; }

Screenshotst

image

jamesmontemagno commented 6 years ago

It is completely possible that the speed is not returned based on the device as Google/Apple do not guarantee it. Only lat/long is guaranteed.