Open calbert52 opened 7 years ago
ListenForSignificantChanges = false
ListenForSignificantChanges = false, did not correct the issue.
On IOS you must meet two condition DeferralTime and DeferralDistanceMeters, then event trigger. And remember to update to at least 4.1.2 or 4.1.2.167. Geolocator on mine still work good on IOS.
@calbert52 How are you testing your app for location changes? Could you elaborate the issue? Did @kingnguyen1993 explanation help you?
No, @kingnguyen1993 explanation did not resolve my issue. I could not spend any more time on trying to get it to work using a lamda event handler on PositionChanged to update my current location. Now testing for location change once every 20 seconds using GetPostionAsync() on a thread.
My code snippet above from Nov 7th should show how I was coding it. My testing was done on a real iOS device, testing in the Xamarin iOS simulator remoted to the PC produced faults. Testing on the iOS simulator on the mac did not produce any faults, but the PositionChanged event never fired.
Hi guys, i'had the same problem on ios in background mode and i solved with a parallel trick under the ios project. I create a CLLocationManager under ios project witch start listening position changes (StartMonitoringSignificantLocationChanges) only when the app enter in background and this wake up the plugin calling my location changes under the pcl.
You can my code in attachment
If you are creating an issue for a BUG please fill out this information. If you are asking a question or requesting a feature you can delete the sections below.
Failure to fill out this information will result in this issue being closed. If you post a full stack trace in a bug it will be closed, please post it to http://gist.github.com and then post the link here.
Bug Information
Version Number of Plugin: 4.1.2 Device Tested On: iPhone 7+ (11.0.3) Simulator Tested On: VS 2017 iPhone 7 Version of VS: Microsoft Visual Studio Enterprise 2017 Version 15.4.2 Version of Xamarin: 4.7.10.33 (70936af)
Versions of other things you are using: VisualStudio.Mac 1.0 Mac Extension for Visual Studio Xamarin 4.7.10.33 (70936af) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin.Android SDK 8.0.2.1 (HEAD/c2a33d8ea) Xamarin.Android Reference Assemblies and MSBuild support. Xamarin.iOS and Xamarin.Mac SDK 11.2.1.0 (12e80e0) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
NuGet packages:
Steps to reproduce the Behavior
Build for iOS loc.StartListeningAsync(...)
Expected Behavior
Listen for changes in location and fire event PositionChanged.
Actual Behavior
Listens for changes in location but never fires the PositionChanged event
Code snippet
Screenshotst