04-16-2019 08:37
04-16-2019 08:37
If you want the fire a short 'bump' alert, to encourage a user to look at their device, but you don't need them to acknowledge or cancel it, what is the best way to do so?
Looking at the API, it's the responsibility of the app to both start and stop the vibration motor. So if you want to create a short 1 second 'bump' alert, would you suggest doing this synchronously in the watchface rendering code (with a 'wait' function) or asynchronously using the Clock tickEvent (or another event)?
If the latter, how do you deal with situation where the clock granularity is set to minutes or hours?
Are there any examples apps/code?
Thank you.
Answered! Go to the Best Answer.
04-16-2019 14:31
04-16-2019 14:31
You don't need to stop the vibrations. They just play once.
import { vibration } from "haptics";
vibration.start("bump");
04-16-2019 14:31
04-16-2019 14:31
You don't need to stop the vibrations. They just play once.
import { vibration } from "haptics";
vibration.start("bump");
04-17-2019 01:14
04-17-2019 01:14
I worked this out eventually 🙂
I understand now that certain alerts were designed to play continuously and others just once. However the API doc doesn't make this clear. I think the documentation could do with a bit of clarification as to which alerts will play continuously until stopped and which are 'one time'.
Interface: Vibration
Functions of the device's vibration motor.
Methods start()
start(pattern: VibrationPatternName)
Returns: boolean
Start a vibration pattern by name.
Available patterns:
stop()
Returns: void
Stop a playing vibration pattern.
If the vibration motor is currently playing a pattern, it will stop. It the vibration motor is not playing anything, this has no effect.
11-04-2020 18:58
11-04-2020 18:58
What is the code for 3 bump commands every 150mS followed by 5 nudge commands every 250 mS and looping that pattern till the Fitbit button is pressed?
07-30-2021 22:04
07-30-2021 22:04
Did you ever get this answered? I am trying to do something similar and cannot get it to work.
07-31-2021 02:54 - edited 07-31-2021 04:22
07-31-2021 02:54 - edited 07-31-2021 04:22
I would try with setting a flag
Absolutely untested, just an idea...
(No usable code, just structure)
08-02-2021 05:47 - edited 08-02-2021 05:48
08-02-2021 05:47 - edited 08-02-2021 05:48
@dzawiskie Have a look at this post
You might want to factor in the weak vibrate on Sense and Versa 3, that gets weaker as the battery level declines. Whereas older models don't suffer in the same way.
Author | ch, passion for improvement.