10-25-2012 05:42 PM
I saw that you can do vibrate in BB10 WebWorks here:
https://github.com/blackberry/WebWorks-Community-A
" navigator.vibrate is supported already "
I have tried navigator.vibrate I can't get it to work. I tried navigator.vibrate, navigator.vibrate(); navigator.vibrate(1000), navigator.vibrate([50, 100, 150]);
Does anyone know how to get it to work? Do you need a permissions element in the config?
Solved! Go to Solution.
10-26-2012 08:09 AM
10-26-2012 09:58 AM
10-26-2012 11:31 AM - edited 10-26-2012 12:59 PM
I just tried three different cases:
1st try: navigator.webkitvibrate;
2nd try: navigator.webkitvibrate(2000);
3rd try: navigator.webkitvibrate([50, 100, 150]);
And it didn't work for me.
Worked with:
navigator.webkitVibrate(2000);
I needed the capitalized "V"!
Thanks!
Although with that code it keeps vibrating. It doesn't go for just 2 seconds. I'll keep experimenting.
...
navigator.webkitVibrate([2000]);
With brackets it will work for the 2 seconds.
...
This successfully did the pattern too:
navigator.webkitVibrate([1000,1000,1000,1000,1000,
10-26-2012 11:58 AM
12-18-2012 04:00 AM
Hi Nukul and all others,
something changed in the API for virbation? I'm searching an event handler to make differentiate between playing a sound or vibrate in my App, but I couldn't find anything about it and you sample
navigator.vibrate(1000);
is throwing a:
TypeError: Type error
Is there a bug in the latest BB10 Version 10.0.9.1675 or something missing in the HTML5 documentation?
12-18-2012 07:04 AM
12-18-2012 08:40 AM - edited 12-18-2012 08:42 AM
Hi Nukul,
I always get a type error with this when directly calling the navigator.vibrate(1000) in Web Inspector:
TypeError: Type error line: 2 message: "Type error" stack: "vibrate@[native code]↵eval code↵eval@[native code]↵evaluate@[native code]↵_evaluateOn↵_evaluateAndWrap↵evaluate↵[native code]" > __proto__: Error
Is there something to be added to the config.xml for it to work?
BTW: Is there an event handler/listener to be able to vibrate instead of playing a sound if the BB10's volume is down/muted?
01-14-2013 05:19 AM
Hi everybody.
Any news on navigator.vibrate.
I'm running the latest BB10 SDK version 1.0.4.7 and BB10 Dev Alpha "A" OS version 10.0.9.2320 [10.9.9.339] but it doesn't work.
I always get the same errors running the samples provided by Nukul.