Jump to content
COMFIED

Vibration API

Recommended Posts

I am trying to use the vibration API on android phone but it's not working - seems there is something I'm not doing right

I have tried the code below, but none is working.  Is there a way to create vibration using SMS code without cordova plugin?

 

asm

  navigator.vibrate(500);

end;

 

and

 

asm

  window.navigator.vibrate([500]);

end;

 

and


 

asm

function vib() {
  navigator.vibrate([500]);
}
vib();

end;

Share this post


Link to post
Share on other sites

try this

browserapi.window.navigator.vibrate(200); // vibrate for 200ms
browserapi.window.navigator.vibrate([100,30,100,30,100,200,200,30,200,30,200,200,100,30,100,30,100]); // Vibrate 'SOS' in Morse.

The vibration api does not work on ios safari, opera and edge

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×