Apache Cordova
  1. Apache Cordova
  2. CB-359

Update geolocation plugin to adhere to W3C specification

    Details

    • Type: Test Test
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: CordovaJS
    • Labels:
      None

      Description

      Need to check that our geo implementations follow the W3C Geolocation Spec.

      Looks like the old/stock implementation (unused impl. on Android and current one on iOS) are just plain wrong.

      First, add tests to mobile-spec and to cordova-js (done).

      Then, implement new requirements imposed on native from cordova-js in the various native platforms. iOS most important here as is the main platform that utilizes our implementation.

      After that is done, we need to test across all of the cordova platforms.

      Finally, once over the documentation.

        Issue Links

          Activity

          Hide
          Filip Maj added a comment -

          test on all tagged platforms plz

          Show
          Filip Maj added a comment - test on all tagged platforms plz
          Hide
          Filip Maj added a comment -

          Untagging platforms for now. First tests need to land in mobile-spec + cordova-js.

          Show
          Filip Maj added a comment - Untagging platforms for now. First tests need to land in mobile-spec + cordova-js.
          Hide
          Filip Maj added a comment -

          I am prototyping the unit tests for the JS (and slowly adding implementation bits) on a branch on my fork here: https://github.com/filmaj/incubator-cordova-js/tree/geotests

          Show
          Filip Maj added a comment - I am prototyping the unit tests for the JS (and slowly adding implementation bits) on a branch on my fork here: https://github.com/filmaj/incubator-cordova-js/tree/geotests
          Hide
          Filip Maj added a comment -

          Generalized the ticket a bit.

          Show
          Filip Maj added a comment - Generalized the ticket a bit.
          Hide
          Filip Maj added a comment -

          Reminder for updating docs.

          Show
          Filip Maj added a comment - Reminder for updating docs.
          Hide
          Filip Maj added a comment -

          Probably won't make it in for 1.6!

          Show
          Filip Maj added a comment - Probably won't make it in for 1.6!
          Hide
          Filip Maj added a comment -

          Added test to mobile spec in 5f7ff8a.

          Show
          Filip Maj added a comment - Added test to mobile spec in 5f7ff8a .
          Hide
          Filip Maj added a comment -

          JavaScript + mobile-spec tests exist. Next step is updating the native framework to conform to the API differences imposed by exec calls for Android, webOS and iOS. The following is something I wrote up for the cordova mailing list which describes the API changes enforced by exec and what actions the native framework should implement, along with what parameters are provided.

          All of this means the the API on the native side for geolocation will change (sorry iOS!). Basically we have three actions that the Geolocation plugin should listen for:

          • getLocation, which takes as parameters enableHighAccuracy (boolean) and maximumAge (int as milliseconds).
          • addWatch, parameter: only the usual callbackID required.
          • clearWatch, parameter: only the usual callbackID required.

          getLocation should require very little changing (other than not needing the timeout parameter anymore, since that is handled on the JS side in my patch).

          addWatch should keep a list of callback Ids, and, as soon as we have one watch started, the native framework should start watching the position for a "significant position difference". Once that happens, it should fire the success callback(s) for all stored watch callback Ids. If there is an issue retrieving position, it should fire the error callback(s) for all stored watch callback Ids.

          Show
          Filip Maj added a comment - JavaScript + mobile-spec tests exist. Next step is updating the native framework to conform to the API differences imposed by exec calls for Android, webOS and iOS. The following is something I wrote up for the cordova mailing list which describes the API changes enforced by exec and what actions the native framework should implement, along with what parameters are provided. All of this means the the API on the native side for geolocation will change (sorry iOS!). Basically we have three actions that the Geolocation plugin should listen for: getLocation, which takes as parameters enableHighAccuracy (boolean) and maximumAge (int as milliseconds). addWatch, parameter: only the usual callbackID required. clearWatch, parameter: only the usual callbackID required. getLocation should require very little changing (other than not needing the timeout parameter anymore, since that is handled on the JS side in my patch). addWatch should keep a list of callback Ids, and, as soon as we have one watch started, the native framework should start watching the position for a "significant position difference". Once that happens, it should fire the success callback(s) for all stored watch callback Ids. If there is an issue retrieving position, it should fire the error callback(s) for all stored watch callback Ids.
          Hide
          Filip Maj added a comment -

          I have a branch for the necessary changes for the native side for iOS set up. Pending reviews from a few other iOS folk, iOS should be done for this shortly.

          Show
          Filip Maj added a comment - I have a branch for the necessary changes for the native side for iOS set up. Pending reviews from a few other iOS folk, iOS should be done for this shortly.
          Hide
          Filip Maj added a comment -

          Tagged remaining components. WP7, Bada and webOS need their native bits lined up. Once those are complete finish off with polishing the docs for geo.

          Show
          Filip Maj added a comment - Tagged remaining components. WP7, Bada and webOS need their native bits lined up. Once those are complete finish off with polishing the docs for geo.
          Hide
          Filip Maj added a comment -

          Updated title to more accurately represent the issue

          Show
          Filip Maj added a comment - Updated title to more accurately represent the issue
          Hide
          Filip Maj added a comment -

          Moving to 1.8; 1.7 will be bug fixes + docs only.

          Show
          Filip Maj added a comment - Moving to 1.8; 1.7 will be bug fixes + docs only.
          Hide
          Filip Maj added a comment -

          Cordova-js changes have been merged in.

          Will be working towards merging the native updates into the platform implementations.

          Show
          Filip Maj added a comment - Cordova-js changes have been merged in . Will be working towards merging the native updates into the platform implementations.
          Hide
          Filip Maj added a comment -

          Tagging as cordova-js, will set up native bits as separate sub-tasks.

          Show
          Filip Maj added a comment - Tagging as cordova-js, will set up native bits as separate sub-tasks.
          Hide
          Filip Maj added a comment -

          Done, yus!

          Show
          Filip Maj added a comment - Done, yus!

            People

            • Assignee:
              Filip Maj
              Reporter:
              Filip Maj
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development