Cordova 3.5.0 vibration plugin works well in firefoxos 1.3, except it does not get executed if screen is locked. Any way to overcome this issue?
Note: the app is certainly running as it plays (at same time of the expected vibration) music
Cordova 3.5.0 vibration plugin works well in firefoxos 1.3, except it does not get executed if screen is locked. Any way to overcome this issue?
Note: the app is certainly running as it plays (at same time of the expected vibration) music
When the screen is off everything goes to sleep, for example: you want get any deviceorientation
events either. The vibrate
function knows this as well, and will return false
.
I would expect that requesting a wakelock for CPU would fix that, but that's not the case. So the only way to get around this currently is to get a wakelock for screen, and not let the screen go off while using your application. It's a pretty bad fix though because it'll drain the battery like crazy.
var l = navigator.requestWakeLock('screen');
// after a while
l.unlock();