Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Web notifications with Polymer & Firebase

Web notifications with Polymer & Firebase

Filip Prochazka

November 26, 2016
Tweet

More Decks by Filip Prochazka

Other Decks in Programming

Transcript

  1. FCM

  2. const title = pushMessage.data.title const notificationOptions = { body: pushMessage.data.body,

    icon: '/images/notification.png', tag: 'notification-tag', data: { targetUrl: pushMessage.data.targetUrl } }
  3. function openWindow(clientList, targetUrl) { clientList.forEach( client => { if (client.url.endsWith(targetUrl)

    && 'focus' in client) { return client.focus() } } return self.clients.openWindow(targetUrl) }