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

Documentation for VibrationPatternName

ANSWERED

I see that VibrationPatternName is documented here

 

https://dev.fitbit.com/build/reference/device-api/haptics/#vibrationpatternname

 

but how to access it?

 

I tried using the repl to search for it... no luck

 

fitbit$ repl$ var haptics = require('haptics')
fitbit$ repl$ for (x in haptics) console.log(x)
fitbit$ repl$ for (x in haptics.vibration) console.log(x)

Thanks!

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

You have to have your own array of the names, as per the app that you linked.

View best answer in original post

Best Answer
0 Votes
5 REPLIES 5

Try:

import { vibration } from "haptics";
vibration.start("ring");

From the documentation:

https://dev.fitbit.com/build/reference/device-api/haptics/

 

Rich

Best Answer
0 Votes

The question is about the VibrationPatternName variable/constant.

Best Answer
0 Votes

It's just a list of possible vibration pattern names.

        | "alert"
        | "bump"
        | "confirmation"
        | "confirmation-max"
        | "nudge"
        | "nudge-max"
        | "ping"
        | "ring"

Best Answer

But how I can read that list from my app?

How can I use it in the app?

 

I would like to use that list in an app, so that I can dynamically create the list of available patters... for example in this app https://github.com/adiroiban/fitbit-os-haptics

 

Thanks!

Best Answer
0 Votes

You have to have your own array of the names, as per the app that you linked.

Best Answer
0 Votes