Skip to content

Instantly share code, notes, and snippets.

@franfj
Last active August 29, 2015 14:21
Show Gist options
  • Save franfj/b98517ebbcfaf8c89ecf to your computer and use it in GitHub Desktop.
Save franfj/b98517ebbcfaf8c89ecf to your computer and use it in GitHub Desktop.
Apache Cordova - Ejemplo API Notificaciones
<!DOCTYPE html>
<html>
<head>
<title>Ejemplo API Notifi</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8">
// Espera a que Cordova haya cargado.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
//Nada implementado
}
function alertDismissed() {
//Nada implementado
}
function mostrarMensaje() {
navigator.notification.alert(
'Hola Mundo!', // Mensaje
alertDismissed, // Callback
'Esto es un ejemplo', // Título del mensaje
'Ok' // Nombre del botón
);
}
</script>
</head>
<body>
<button onclick="mostrarMensaje(); return false;">Mostrar mensaje</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment