How do i call the functions in Pedometer plugin from Outsystems?

How do i call the functions in Pedometer plugin from Outsystems?

  

Hi,


I am trying to use the following plugin in a mobile app

https://github.com/leecrossley/cordova-plugin-pedometer

I created a blanked module, set its configurations property with the JSON statement and link to the .git url.

Now i am stuck implementing the StartPedometerUpdates function. How do i pass the data from the plugin back?

I have something like the following in a Javascript widget in the client action, but don't know how to declare and retrieve the pedometerData. The parameters are defined as datatype Object and boolean respectively. I am testing it on Android 6.0 as a native app.


pedometer.startPedometerUpdates(
    function($parameters.pedometerData){
       
    },
    function() {
        $parameters.Success = false;
    }
);


Thanks in advance for any help/advice.

Hi Kenneth,

You will have to call a client-side action in order to get regular updates from the pedometer:

pedometer.startPedometerUpdates(
    function(pedometerData){
        $actions.YouClientSideActionThatHandlesUpdates(pedometerData.distance);
    },
    function() {
        $actions.YouClientSideActionThatHandlesErrors("Ups something wrong happened");
    }
);