var firebaseConfig = { apiKey: "AIzaSyB8JMIJDga0k0sSW2NFYnuVuHgvfrVZf6Y", authDomain: "ibrandox-1f97c.firebaseapp.com", URL de base de datos: "https://ibrandox-1f97c.firebaseio.com", projectId: "ibrandox-1f97c", storageBucket: "ibrandox -1f97c.appspot.com", messengerSenderId: "44964557397" }; firebase.initializeApp(firebaseConfig); const mensajería = firebase.messaging(); mensajería.usePublicVapidKey('BB7JUk3BB0QVxlFXRgZq9jiWWU5F03B5EDKuLGD0ktE21Soy05yuM7V5FzdiSFv6OCmMjXpIvpTXt7BpC3wtzew') mensajería.requestPermission().then(función () { console.log('notificación otorgada'); SaveClientID(currentToken) document.getElementById('token').innerHTML = currentToken; }).catch(function (err) { console.log('ocurrió un error al retirar el token', err); showToken('Error', err) ; setTokenSendToServer(false); }); }).catch(function (err) { console.log('no se puede notificar', err); }); mensajería.onMessage(función (carga útil) { var obj = JSON.parse(carga útil.datos.notificación); var notificación = nueva Notificación(obj.título, { icono: "https://www.ibrandox.com/assets/images /push_notification-logo.png", body: obj.body, //requireInteraction: true, data: { time: new Date(Date.now()).toString(), click_action: obj.click_action } }); }) ; function SaveClientID(currentToken) { $.ajax({ tipo: "POST", url: 'https://www.ibrandox.com/ToyRenting.aspx/SaveClientID', data: '{"currentToken":"' + currentToken + '"}', contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (result) { if (result.d.toString() != "") { } } } ); }
(función () {var script = document.createElement('script');script.src = 'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js' ;script.async = false;document.head.appendChild(script);}()) var __cp = {"id":"ZJNT-93H6GuR8-ApMtEn6qtwMswF1jDEllWMy_4qthU","version":"1.1"};(función (ventana, documento) {var cp = documento.createElement('script');cp.type = 'text/javascript';cp.async = false;cp.src = "++cdn-widget.callpage.io+build+js+ callpage.js".replace(/[+]/g, '/').replace(/[=]/g, '.');var s = document.getElementsByTagName('script')[0];s. parentNode.insertBefore(cp, s);if (window.callpage) {alert('¡Solo podría tener 1 código CallPage en su sitio web!');} else {window.callpage = function (método) {if (método == '__getQueue') {return this.methods;} else if (método) {if (tipo de ventana.callpage.execute === 'función') {return window.callpage.execute.apply(this, arguments);}else { (this.methods = this.methods || []).push({argumentos: argumentos});}}};window.callpage.__cp = __cp;window.callpage('api.button.autoshow');}} )(ventana, documento);