Last active
December 15, 2015 05:49
-
-
Save jrbistuer/5212128 to your computer and use it in GitHub Desktop.
This is a Phonegap Listener to a Native Mobile Event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta name="format-detection" content="telephone=no" /> | |
<meta name="viewport" content="user-scalable=no, width=device-width, target-densitydpi=device-dpi" /> | |
<title>Pausing an application</title> | |
<script type="text/javascript" src="cordova-2.5.0.js"></script> | |
<script type="text/javascript"> | |
document.addEventListener("deviceready", onDeviceReady, false); | |
function onDeviceReady() { | |
document.addEventListener("pause", onPause, false); | |
} | |
function onPause() { | |
//Vibration time in miliseconds | |
navigator.notification.vibrate(2000); | |
} | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment