This problem seems like a real disaster for anyone writing web-based geolocation apps, since iOS devices have such a high market share. Please make sure you submit a bug report to apple at bugreport.apple.com!
Most likely the same problem as (I didn’t have a reputation for posting there): iOS 6 splits GeoLocation into webapps (apple-mobile-web-app-able)
I put together a test page that you can use if you want to investigate this problem:
- Open http://jsbin.com/esasix/16/ on your iPhone or iPad.
- Walk on the outside, refresh the page and try another test.
- See how your position is reported.
I tested myself a lot with the following results:
Tests completed:
Native tests using this simple test page: jsbin.com/esasix/16/
Custom tests with maps.google.com mobileweb map
Native tests using my application
Many logs from external users of my application
Tested using different devices
My findings:
In the same tests, I often get perfect positioning with an accuracy of 5 m, as well as poor reception caused by an error. This means that the device, location, weather, time of day, etc. The same in both situations.
Sometimes after loading the page only one position is returned.
Sometimes after loading a page, several items are returned.
Sometimes a few good positions return, and then the return of positions suddenly stops (sometimes this happens after you have stopped for a while), and it goes into a bad state, maybe returns again, but it is often bad.
Sometimes many positions return with an accuracy of 65 m.
Sometimes many positions return with poor accuracy (usually 50-300 m).
These series of positions with poor accuracy are sometimes close to the series of perfect with an accuracy of 5 m (after it entered a poor state?).
Sometimes everything works fine for many tests in sequence :-)
These behaviors seem to appear in various combinations.
In some situations, re-opening Safari seems to redo something, and it starts working again. However, in some of these situations, he worked only for some time, and in other situations, he did not affect everything so that it could be used as a reliable workflow (?). The same behavior appears when you open the built-in map application, sometimes it helps, sometimes it's not ...
Tested with code that uses navigator.geolocation.watchPosition, as well as code that calls navigator.geolocation.getCurrentPosition in a loop at regular intervals, and it does not matter, in both cases the same problems are visible.
It seems that for iOS version 6.0 - 6.1.2 I do not use the apple-mobile-web-app meta tag.
I found that sometimes individual tests show that a specific behavior appears leading to the conclusions made, but then another test proves that the conclusion is wrong. I have not yet been able to find any behavior (or solution) that is reliably reproducible.