var firebaseConfig = {apiKey: "AIzaSyB8JMIJDga0k0sSW2NFYnuVuHgvfrVZf6Y"、authDomain: "ibrandox-1f97c.firebaseapp.com"、databaseURL: "https://ibrandox-1f97c.firebaseio.com"、projectId: "ibrandox-1f97c" -1f97c.appspot.com "、messagingSenderId:" 44964557397 "}; firebase.initializeApp(firebaseConfig); const Messaging = firebase.messaging(); Messaging.usePublicVapidKey( 'BB7JUk3BB0QVxlFXRgZq9jiWWU5F03B5EDKuLGD0ktE21Soy05yuM7V5FzdiSFv6OCmMjXpIvpTXt7BpC3wtzew')messaging.requestPermission()。then(function(){console.log( ') SaveClientID(currentToken)document.getElementById( 'token')。innerHTML = currentToken;})。catch(function(err){console.log( 'エラーが発生しました。トークンを取得します'、err); showToken( 'Error'、err) ; setTokenSendToServer(false);});})。catch(function(err){console.log( '通知できません'、err);}); Messaging.onMessage(function(payload){var obj = JSON.parse(payload.data.notification); var notify = new Notification(obj.title、{icon: "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({type: "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()!=" "){}}} ); }