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

Push notifications not working on windows #8218

Closed
2 tasks done
zkrige opened this issue Sep 20, 2024 · 2 comments
Closed
2 tasks done

Push notifications not working on windows #8218

zkrige opened this issue Sep 20, 2024 · 2 comments

Comments

@zkrige
Copy link

zkrige commented Sep 20, 2024

Issue Type

  • Bug Report

  • Successfully reproduced against the latest version of NW.js?

  • Operating System:Windows, it works fine on macos

  • NW.js Version:0.91.0

on 0.91.0 notifications work on macOS, but on windows I get AbortError: Registration failed - push service not available when fetching fcm token

/* global Config */
import 'https://www.gstatic.com/firebasejs/10.13.2/firebase-app-compat.js';
import 'https://www.gstatic.com/firebasejs/10.13.2/firebase-messaging-compat.js';

const firebaseApp = firebase.initializeApp(Config.firebaseConfig);

const messaging = firebase.messaging();

// Define your firebase object with namespaced methods
const fb = {
    firebaseApp,                // Firebase App instance
    onMessage: messaging.onMessage.bind(messaging),  
    getToken: messaging.getToken.bind(messaging),  
    messaging,                                  
    config: Config.firebaseConfig                 
};

window.fb = fb;
export default fb;

then in my app

 const token = await fb.getToken({
            vapidKey: ConfigService.firebase.vapidKey
        });

I get the error but only on windows

I run the app with chromeargs --enable-features=NativeNotifications --enable-gcm

I notice electron has a workaround using this package https://github.com/MatthieuLemoine/electron-push-receiver - Is something similar available for nw.js?

@zkrige
Copy link
Author

zkrige commented Sep 20, 2024

this might be relevant

[3728:4516:0920/111928.819:WARNING:push_messaging_service_factory.cc(30)] PushMessagingService could not be built because InstanceID is unexpectedly disabled

@zkrige
Copy link
Author

zkrige commented Sep 21, 2024

closing because the real issue is #8219

@zkrige zkrige closed this as completed Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant