MCPcopy Create free account
hub / github.com/firebase/quickstart-js / sendTokenToServer

Function sendTokenToServer

messaging/main.ts:56–64  ·  view source on GitHub ↗
(currentToken: string)

Source from the content-addressed store, hash-verified

54// - send messages back to this app
55// - subscribe/unsubscribe the token from topics
56function sendTokenToServer(currentToken: string) {
57 if (!isTokenSentToServer()) {
58 console.log('Sending token to server...', currentToken);
59 // TODO(developer): Send the current token to your server.
60 setTokenSentToServer(true);
61 } else {
62 console.log('Token already sent to server so won\'t send it again unless it changes');
63 }
64}
65
66function isTokenSentToServer() {
67 return window.localStorage.getItem('sentToServer') === '1';

Callers 1

resetUIFunction · 0.85

Calls 2

isTokenSentToServerFunction · 0.85
setTokenSentToServerFunction · 0.85

Tested by

no test coverage detected