yo estoy haciendo esto
const firebaseApp = initializeApp(configs.FIREBASE) const messaging = getMessaging(firebaseApp) getToken(messaging, { vapidKey: configs.FIREBASE.vapidKey }) .then((currentToken) => { if (currentToken) { fcm_token.value = currentToken } else { // Show permission request UI console.log('No registration token available in app. Request permission to generate one.'); // ... } }).catch((err) => { console.log('An error occurred while retrieving token in app. ', err) // ... }); onMessage(messaging, (payload) => { const notificationTitle = payload.notification.title Notify.create(notificationTitle) const notificationOptions = { body: payload.notification.body, icon: payload.notification.icon, click_action: payload.notification.click_action } if (!('Notification' in window)) { return; } if (Notification.permission === 'granted') { const notification = new Notification(notificationTitle, notificationOptions) notification.onclick = function (event) { event.preventDefault() window.open(payload.notification.click_action, '_blank') notification.close() } } }) No puedo encontrar información sobre la vida de currentToken . ¿Cuánto tiempo dura?
Además... Si/cuando caduca, ¿cómo mi aplicación puede darse cuenta de su muerte?