jamesmontemagno / GeolocatorPlugin

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

GetPositionAsync() fails when air plane mode is on. #281

Closed TaiwoAkinremi closed 1 year ago

TaiwoAkinremi commented 6 years ago

Bug Information

The application hangs when GetPositionAsync(); is called when air plane mode is one.

Version Number of Plugin: 4.5.0.6 Device Tested On: Samsung SM-J530F Android version: 9 Version of VS: 4.7.03056 Version of Xamarin: 3.2.0.871581

Steps to reproduce the Behavior

Turn on airplane mode. Call GetPositionAsync()

Expected Behavior

The position will be obtained

Actual Behavior

The app hangs

Code snippet

var permissionStatus = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.Location); if (permissionStatus == PermissionStatus.Granted && CrossGeolocator.Current.IsGeolocationAvailable && CrossGeolocator.Current.IsGeolocationEnabled) { currentPosition = await CrossGeolocator.Current.GetPositionAsync(); }

TaiwoAkinremi commented 1 year ago

This has been open for years. I doubt it will be fixed so closing it