Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to make messaging website with firebase javascript

index.html//Put this inside the script//Below above snippet code.messaging.getToken({vapidKey: 'MY_VAPID_KEY'}).then((currentToken) => {if (currentToken) {console.log("token is ",currentToken);//Send this token to your server and store it.} else {console.log('No registration token available. Request permission to generate one.');}}).catch((err) => {console.log('An error occurred while retrieving token. ', err);});
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #messaging #website #firebase #javascript
ADD COMMENT
Topic
Name
1+7 =