Android accelerometer data

I have a simple meteor test app where I’m just trying to collect the accelerometer data from an android phone and display the values on the main page

Following the instructions for the device motion plugin ( I have come up with the following:

  {{> GPS}}

  {{> accelerometer}}

<template name="GPS">
  <p>Latitude: {{latitude}}</p>
  <p>Longitude: {{longitude}}</p>

<template name="accelerometer">
    <p>X: {{getAcc}}</p>
    <p>Y: {{getAcc}}</p>
    <p>Z: {{getAcc}}</p>

and my js file:

if (Meteor.isClient) {

    latitude: function () {
      return Geolocation.latLng()['lat'];

    longitude: function () {
      return Geolocation.latLng()['lng'];

    onSuccess: function(acceleration){
      return "success";

    onError: function(acceleration){
      return "error";

    getAcc: function(){
      var options = { frequency: 1000 };

      var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options);

      return watchID;

Right now, I’m simply expecting the page to show “success” next to X, Y, and Z. In my mind getAcc gets called, which in turns called onSuccess which will return “success” to watchID, which then gets printed to the page

The problem is neither “success” nor “error” display on the page and I’m not sure why. Did I implement the functions wrong?

I have also tried something like this, to no avail:

getAcc: function(){
      function onSuccess(acceleration) {
          alert('Acceleration X: ' + acceleration.x + '\n' +
                'Acceleration Y: ' + acceleration.y + '\n' +
                'Acceleration Z: ' + acceleration.z + '\n' +
                'Timestamp: '      + acceleration.timestamp + '\n');

      function onError() {

      return navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);

Where you able to solve this.?