Skip to content

Instantly share code, notes, and snippets.

@mcav
Created February 25, 2014 19:57
Show Gist options
  • Save mcav/9216513 to your computer and use it in GitHub Desktop.
Save mcav/9216513 to your computer and use it in GitHub Desktop.
Utils.safeWakeLock({type: 'screen', timeoutMs: timeout + 5000},
function(done) {
this.started = unique;
this.wakelock = done;
this.display();
this.ring(true);
this.vibrate(this.notificationOptions.vibrate);
if (document.hidden) {
window.focus();
}
setTimeout(function rv_clearVibration() {
if (this.started === unique) {
this.stopNotify();
}
done();
}.bind(this), timeout);
}.bind(this));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment