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

Misleading documentation in Device Motion Plugin

    XMLWordPrintableJSON

Details

    Description

      device motion documentation reads

      The returned watch ID references the accelerometer's watch interval, and can be used with navigator.accelerometer.clearWatch to stop watching the accelerometer.
      
      var watchID = navigator.accelerometer.watchAcceleration(accelerometerSuccess,
                                                             accelerometerError,
                                                             [accelerometerOptions]);
      

      last line indicates an array is the expected argument, which causes the api to return an error

      it should read

      accelerometerOptions);
      

      the rest of watchAccel correctly documents accelerometerOptions as an object.

      Also noted that period optional member is incorrectly called 'frequency'.

      Attachments

        Activity

          People

            lorin.beer Lorin Beer
            lorin.beer Lorin Beer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: