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

vibration does't work when Device screen is off

ANSWERED

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?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

clock.ontick doesn't happen when the display is off. Use setTimeout.

Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
3 REPLIES 3

clock.ontick doesn't happen when the display is off. Use setTimeout.

Peter McLennan
Gondwana Software
Best Answer

Thanks a lot for immediate response!

Best Answer
0 Votes

Off the top of my head, Date.now()

Peter McLennan
Gondwana Software
Best Answer
0 Votes