02-10-2019 14:00
02-10-2019 14:00
Hi, I'm working on custom clockface for Fitbit. I need to vibrate my Fitbit device on certain hours. However, device vibration doesn't work when the device screen is off.
I use the following code to initialize vibration at a certain hour.
clock.ontick = (evt) => {
const today_dt = evt.date;
const currentHour = today_dt.getHours();
if(currentHour == 17) {
vibration.start("ring");
}
}
Please let me know what I can do to initialize vibration at certain hours?
Answered! Go to the Best Answer.
02-10-2019 14:10
02-10-2019 14:10
clock.ontick doesn't happen when the display is off. Use setTimeout.
02-10-2019 14:10
02-10-2019 14:10
clock.ontick doesn't happen when the display is off. Use setTimeout.
02-10-2019 14:18
02-10-2019 14:18
Thanks a lot for immediate response!
02-10-2019 14:28
02-10-2019 14:28
Off the top of my head, Date.now()