Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/brunos3d/firebase-messaging-sw.js

💬 JAVASCRIPT - Firebase service worker with custom icon and "fallback icon", notification click_action and custom data.
https://github.com/brunos3d/firebase-messaging-sw.js

action click cloud fcm firebase javascript messaging monkey-patch notification push service-worker web

Last synced: 5 days ago
JSON representation

💬 JAVASCRIPT - Firebase service worker with custom icon and "fallback icon", notification click_action and custom data.

Awesome Lists containing this project

README

        

# firebase-messaging-sw.js
💬 JAVASCRIPT - Firebase service worker with custom icon and "fallback icon", notification click_action and custom data.

Extracted and modified from

https://github.com/firebase/quickstart-js/issues/71

### 🖼️ Icon
You can pass an icon through the Firebase interface, otherwise the default icon will be `YOUR_APP_DOMAIN/icons/firebase-logo.png`

![image](https://user-images.githubusercontent.com/21183964/118019538-7acca980-b32f-11eb-9aa2-a8240e9c6b49.png)

### 🖱️ Click action

`click_action` is an optional parameter that must be entered in the notification panel of firebase cloud messaging as shown below. When clicking on the notification, the user will be redirected to the link informed as the value of the `click_action` parameter, if the parameter is not informed the user will be redirected to the host of the application

![image](https://github.com/BrunoS3D/firebase-messaging-sw.js/blob/main/image.png)