(currentToken: string)
| 54 | // - send messages back to this app |
| 55 | // - subscribe/unsubscribe the token from topics |
| 56 | function 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 | |
| 66 | function isTokenSentToServer() { |
| 67 | return window.localStorage.getItem('sentToServer') === '1'; |
no test coverage detected