Skip to content

.getToken() method on AngularFireMessaging fails too early on notification mermission. #2762

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

Closed
nmggithub opened this issue Feb 21, 2021 · 3 comments

Comments

@nmggithub
Copy link

Version info

Angular: 11.2.0

Firebase: 8.2.7

AngularFire: 6.1.4

How to reproduce these conditions

Steps to set up and reproduce
Simply call .getToken() on an AngularFireMessaging object when the notification permission in the browser is set to default.

Debug output

None / N/A

Expected behavior

As is the case with the regular firebase.messaging() object, it requests the permission when called.

Actual behavior

The notification permission is not requested, and the observable returns null.

@geromegrignon
Copy link

@nmggithub
Copy link
Author

Do you use Angular Service Worker? https://github.com/angular/angularfire/blob/master/docs/messaging/messaging.md

No I do not. This issue is only here because the PR I made required one. This is a failure in the code logic.

@jamesdaniels
Copy link
Member

the new v7 api, modular, mirrors the JS SDK exactly rather than keeping with legacy

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

3 participants