0

I have a small problem with the ionic native vibration plugin. https://ionicframework.com/docs/native/vibration/

As you may know, you can no longer set the vibration time or pattern for ios users. However in my app i am about to create an alarm-clock so it will play a sound or vibrate until the user shake the device. Do you know any workaround for this so it can works on IOS too? Or at least a 30 sec long vibration?

user3551399
  • 93
  • 2
  • 11

1 Answers1

1

maybe you can use setInterval like this

let stop = false;
let timer = setInterval(()=>{
    if(stop){clearInterval(timer)}
    this.vibration.vibrate(1000);
},1000)

and when stop===true it will not vibrate

coder
  • 23
  • 5