I am making an application which tracks the user. I have notice when the application goes in the background and then when you open the app it’s shows the wrong current location for the user until about 5 seconds. Is there to fix that because that 5 seconds delay ruins the tracking results ( it’s adds three extra miles for no reason ).
Edit: The issue wasn’t actually a “bug”. I have to set in my Info.plist that I want background pocessing and boom the application tracking is super Accurate. A little tutorial to do that:
- Go to Info.plist
- Add an New Row called “Required background modes”
- Then add again a new row called “App registers for location updates”
- We are Done 🙂
One thing you can do is check the
horizontalAccuracyproperty on theCLLocationthat you’re being returned. If this is above a certain threshold then you could throw away the result and wait for a more accurate one. If it is a number of miles out then I would expect the accuracy figure to be quite large. It’s most likely using a cell site to determine location rather than GPS, and the margin of error would be much greater.In your
CLLocationManagerDelegate‘slocationManager:didUpdateLocations:method you could do the following: