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?
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?
Share Improve this question edited May 20, 2024 at 0:58 Cornelius Roemer 7,9493 gold badges52 silver badges100 bronze badges asked Jun 26, 2015 at 22:19 Isiah LIsiah L 4875 silver badges21 bronze badges 1- Strange,I tested this now and it works fine on stable, beta and dev chrome for android, it's not the problem with code or chrome(on my device). – Blago Eres Commented Jun 26, 2015 at 22:30
3 Answers
Reset to default 15Stupid me, Chrome For Android follows what sound profile you are currently on. While Firefox does not. So to feel vibrations your sound profile must be on vibrate or above.
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
In addition to vibrations not being disabled through Do not disturb etc, on Android 14 (Pixel), it is required to have "Touch feedback" not set to off (it's a slider) in: Settings > Vibration & haptics > Interactive haptics > Touch feedback