-
Notifications
You must be signed in to change notification settings - Fork 987
Closed
Description
Operating System
Windows 10
Browser Version
Versão 122.0.6261.94 (Official Build, ungoogled-chromium) 64 bits
Firebase SDK Version
^10.12.0
Firebase SDK Product:
Messaging
Describe your project's tooling
JavaScript, PHP, PNPM
Describe the problem
The getToken method is called but does never returns an result from the async result. This only happens on Ungoogled Chromium browser, but not other browsers like Edge or Firefox.
Steps and code to reproduce issue
I'm running this code as an module on the website running at an HTTPs localhost endpoint. The service worker file is present.
import { initializeApp } from "firebase/app";
import { getMessaging, getToken } from "firebase/messaging";
const firebaseConfig = {
;
};
initializeApp(firebaseConfig);
const messaging = getMessaging();
window.initNotificationService = () => {
Notification.requestPermission().then(permission => {
if (permission == 'granted') {
console.log("perm granted");
getToken(messaging, { vapidKey: '...' })
.then((currentToken) => {
if (currentToken) {
console.log(currentToken);
} else {
// Show permission request UI
console.log('No registration token available. Request permission to generate one.');
// ...
}
})
.catch((err) => {
console.log('An error occurred while retrieving token. ', err);
// ...
});
}
});
};Edge:
Firefox:
Ungoogled Chromium:


