Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getToken not working on Ungoogled Chromium #8252

Closed
CypherPotato opened this issue May 17, 2024 · 3 comments
Closed

getToken not working on Ungoogled Chromium #8252

CypherPotato opened this issue May 17, 2024 · 3 comments

Comments

@CypherPotato
Copy link

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:

image

Firefox:

image

Ungoogled Chromium:

image

@CypherPotato CypherPotato added new A new issue that hasn't be categoirzed as question, bug or feature request question labels May 17, 2024
@jbalidiong jbalidiong added needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels May 17, 2024
@DellaBitta
Copy link
Contributor

Hi @CypherPotato,

It sounds like the Ungoogled Chromium implementation purposefully doesn't provide the fundamental support for what the Messaging implementation requires from a web browser. Is that your understanding as well?

Thanks!

@CypherPotato
Copy link
Author

CypherPotato commented May 21, 2024

Hello @DellaBitta.

Yes, as discussed in ungoogled-software/ungoogled-chromium#2867, we concluded that the issue is an expected behavior just because the unchromium doens't listen to google push services.

I'm closing the issue now. Thank you.

@DellaBitta
Copy link
Contributor

Hi @CypherPotato,

OK, and thanks for getting back to us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants