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");
    }
);

Hello Mates,


I have created component illustrating implementation of cordova's pedometer plugin for Outsystems mobile application, have a look.

https://www.outsystems.com/forge/component/2773/pedometer/


Hope it will be helpful for the community :)


Thanks and Regards,

Atul Patel


Atul Patel wrote:

Hello Mates,


I have created component illustrating implementation of cordova's pedometer plugin for Outsystems mobile application, have a look.

https://www.outsystems.com/forge/component/2773/pedometer/



Hope it will be helpful for the community :)


Thanks and Regards,

Atul Patel




Hi Mate, 

is it possible for me to run the pedometer on the background forever and save it to the local database?

If User allows it... 

hope to hear from u soon. 

thank you. 

Regards
Olivier Cheah