Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Vibration in Monaca
-
Hello
I have been struggling with monaca trying to get my phone vibrate but it doesnt seems to work.
Even the HelloWorld example doesnt vibrate and I have checked all.The phone I am using is a Samsung S4 that actually vibrates with normal JavaScript code:
navigator.vibrate(1000);
but when I try it in a Monaca App, it doesn’t work.
Someone knows what I am doing wrong? Thank you
-
@Racafe I just tested this and it worked on a Samsung Galaxy S6.
<script> window.fn = {}; window.fn.vibrate = function() { navigator.vibrate([1000]); }; </script> <ons-page> <ons-button onclick="fn.vibrate()">Vibrate</ons-button> </ons-page>
Maybe try using brackets around your time.
-
Your solution works!!! Thank you!!