function registrarPush(sPushId,selfObject) { /** Ordenamos el registro push. **/ appData.registerPush(sPushId); appData.bind("onPushRegistered", function(evento) { /* * Lo que queramos hacer cuando ya tengamos registrado el dispositivo y tengamos token */ let ventana = ui.getView(selfObject); if (ventana === null) { return; } selfObject.MAP_TOKENPUSH = evento.pushToken; ventana.refresh("MAP_TOKENPUSH"); //ui.showToast("onPushRegistered(), Token push: " + evento.pushToken); }); appData.bind("onPushReceived", function(evento) { /* * Aquí es donde recibimos un mensaje push, con los extras en forma de * un objeto javascript normal y corriente. Previamente le hemos filtrado * los extras del mensaje push verdadero que sean del framework */ //ui.showToast("¡Mensaje push recibido!"); if (evento.notification-type===0){ ui.showToast(evento.notification_title); } }); appData.bind("onPushRegistrationFailure", function(mEvento) { //ui.msgBox("Mensaje", "Ha ocurrido un error al registrar el push", 0); }); }