Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-8523

enableHighAccuracy: false doesn't work on iOS

    XMLWordPrintableJSON

Details

    Description

      According to my tests and to what I see in the source the GPS is almost always used even when enableHighAccuracy is set to false.

      The w3 spec says ( http://dev.w3.org/geo/api/spec-source.html#high-accuracy ) about enableHighAccuracy that:

      "The intended purpose of this attribute is to allow applications to inform the implementation that they do not require high accuracy geolocation fixes and, therefore, the implementation can avoid using geolocation providers that consume a significant amount of power (e.g. GPS)."

      But the plugin uses kCLLocationAccuracyNearestTenMeters which is not a good choice for implementing that. There is hardly a low-power (non-GPS) method available which can provide 10 meters accuracy.

      The TODO comment also says that this is "arbitrary": https://github.com/apache/cordova-plugin-geolocation/blob/master/src/ios/CDVLocation.m#L156

      I suggest using kCLLocationAccuracyThreeKilometers. Any other constant will lead to GPS usage in rural environments when the wifi is off.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tisztamo Krisztián Schäffer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: