transfer project in github
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
importScripts(
|
||||
'https://www.gstatic.com/firebasejs/8.10.1/firebase-app.js'
|
||||
)
|
||||
importScripts(
|
||||
'https://www.gstatic.com/firebasejs/8.10.1/firebase-messaging.js'
|
||||
)
|
||||
firebase.initializeApp({"apiKey":"AIzaSyB6PlyAxtiuc3Lr8PM5y2W8E_KxWrXDSkI","authDomain":"barg-336706.firebaseapp.com","projectId":"barg-336706","storageBucket":"barg-336706.appspot.com","messagingSenderId":"889370893165","appId":"1:889370893165:web:198f891c6c49fc13a09864","measurementId":"G-C91HQP1H4V"})
|
||||
|
||||
// Retrieve an instance of Firebase Messaging so that it can handle background
|
||||
// messages.
|
||||
const messaging = firebase.messaging()
|
||||
|
||||
self.addEventListener('push', function (e) {
|
||||
console.log('test*******************************')
|
||||
data = e.data.json();
|
||||
var options = {
|
||||
body: data.notification.body,
|
||||
icon: '/favicon.png',
|
||||
vibrate: [100, 50, 100],
|
||||
data: {
|
||||
dateOfArrival: Date.now(),
|
||||
primaryKey: '2'
|
||||
},
|
||||
};
|
||||
e.waitUntil(
|
||||
self.registration.showNotification(data.notification.title, options)
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user