Search code examples
javascriptandroidgoogle-chromeandroid-vibrationbrowser-api

Chrome for Android: Vibrate API


When trying to use the Vibrate API in Chrome for Android (tested stable version 43 and dev version 45), it never vibrates. Using the simplest code:

window.navigator.vibrate(200);

When ran from the Javascript console, it returns true. Vendor prefixes don't fix it. The Chrome Status website shows the API was implemented in version 32. This code works in Firefox for Android. Is this a problem with Chrome or a problem with my code?


Solution

  • Chrome vibration api won't work if your Android phone were using specific settings, including but not limited to:

    • Silent Mode: on
    • Do Not Disturb: on
    • Power Saving Mode: on
    • Vibration & Touch Feedback: disabled