Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<title>Tutorial Push</title>
document.addEventListener("deviceready", deviceReady, false);
function deviceReady() {
var push = PushNotification.init({
android: {
senderID: "455908641475"
ios: {
alert: "true",
badge: "true",
sound: "true"
push.on('registration', function(data) {
document.getElementById("idDispositivo").innerHTML = data.registrationId;
push.on('notification', function(data) {
var ul = document.getElementById("notificacionesPush");
var li = document.createElement("li");
li.appendChild(document.createTextNode(data.title+": "+data.message));
<div class="app">
<h1>Tutorial Push</h1>
<p id="idDispositivo"></p>
<ul id="notificacionesPush">
<script type="text/javascript" src="cordova.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment