Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fitbit vibrate on location

Hello everybody

 

I'm doing a project with some friends, and we're trying to create a fitbit app for the Versa 3. I do the design, somebody else is doing the code and an other person does research.

 

Our coder is unfortunately still a beginner, and to let our app work he needs to make it so that it vibrates when you are in a certain location. He knows how to make the fitbit monitor the current location, and he knows how to make the device vibrate, but he can not for the love of god connect the two of them.

 

Anybody that can help? 

Best Answer
0 Votes
1 REPLY 1

Something like this:

 

import { geolocation } from "geolocation";
import { vibration } from "haptics";

var watchID = geolocation.watchPosition(locationSuccess, locationError, { timeout: 60 * 1000 });

function locationSuccess(position) {
    console.log("Latitude: " + position.coords.latitude,
                "Longitude: " + position.coords.longitude);
    vibration.start("nudge");
}

function locationError(error) {
  console.log("Error: " + error.code,
              "Message: " + error.message);
}
Best Answer
0 Votes