importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/4.8.1/firebase-messaging.js');
console.log('Init');
firebase.initializeApp({
'messagingSenderId': '513999950945'
});
const messaging = firebase.messaging();
self.addEventListener('notificationclick', e => {
console.log(e.notification);
let found = false;
let f = clients.matchAll({
includeUncontrolled: true,
type: 'window'
})
.then(function (clientList) {
for (let i = 0; i < clientList.length; i ++) {
if (clientList[i].url === e.notification.data.click_action) {
// We already have a window to use, focus it.
found = true;
clientList[i].focus();
break;
}
}
if (! found) {
if (! e.action) {
clients.openWindow(e.notification.data.click_action).then(function (windowClient) {});
} else {
switch (e.action) {
case '1':
clients.openWindow(e.notification.data.actions[0].link);
case '2':
clients.openWindow(e.notification.data.actions[1].link);
}
}
}
});
e.notification.close();
e.waitUntil(f);
});
// [START background_handler]
messaging.setBackgroundMessageHandler(function (payload) {
console.log('[firebase-messaging-sw.js] Received background message ', payload);
if (payload.data.id) {
let id = payload.data.id;
let ver = '0.2';
fetch('https://pushbank.pushdom.co/subscriptions/web/update', {
method: 'POST',
body: JSON.stringify({id: id, ver: ver})
}).then(response => console.log(response.status));
}
if (payload.data.actions) {
let actionsObj = JSON.parse(payload.data.actions);
payload.data.actions = actionsObj;
}
return self.registration.showNotification(payload.data.title,
Object.assign({data: payload.data}, payload.data));
});
// [END background_handler]
Did you know there's a 12 word sentence you can say to your crush... that will trigger intense feelings of love and impulsive attraction for you buried inside his heart?
ReplyDeleteBecause deep inside these 12 words is a "secret signal" that triggers a man's instinct to love, look after and look after you with all his heart...
===> 12 Words That Trigger A Man's Love Impulse
This instinct is so hardwired into a man's mind that it will drive him to work harder than ever before to love and admire you.
Matter-of-fact, fueling this influential instinct is absolutely important to getting the best ever relationship with your man that the moment you send your man one of the "Secret Signals"...
...You'll soon find him expose his mind and heart to you in such a way he haven't experienced before and he'll distinguish you as the only woman in the galaxy who has ever truly attracted him.