Closed snorreks closed 3 years ago
When I add the vapidKey directly in the getToken() method:
const currentToken = await this.app.$fire.messaging.getToken({
vapidKey:
'BByfCgJXUoNb2HC5g-BZIZxAAG5r03RIjmVDV8ubCxu7XIqmkWKuRqmU4-yTMxEoNYEB8VHmqoawipFE5XYK0yg'
});
I get this error:
DOMException: Registration failed - push service error
which is the same error I see on the demo page: https://nuxt-fire-demo.herokuapp.com/ when I click on "Get ID Token".
Update:
When I add the vapidKey directly in the getToken() it works on ssr: false.
Hey @snorreks
What browser & version are you testing this with? Did you try with e.g. the current version of Chrome? Does the error still appear?
If so: Could you check out how we do it in the demo app and see if if you do it similarly the same error appears?
Where exactly is the code you pasted under Reproduction Link? In a vue component?
br, Pascal
It was only a brave error, have now tested on chrome, edge and firefox and they are all working 👍
Found the solution on the brave browser also: https://github.com/brave/brave-browser/issues/12850
Version
@nuxtjs/firebase: 7.1.0 firebase: 8.0.2 nuxt: 2.14.7
Reproduction Link
Steps to reproduce
My nuxt config:
I get what I believe to be the encoded fcmPublicVapidKey from here:![image](https://user-images.githubusercontent.com/36089469/99242947-33da7d00-2800-11eb-8ab3-c2be3bfc1212.png)
I get the same error when I have ssr: true or false. And when i have modern: true or false. When I googled the error people said to add the polyfill: https://github.com/davidchambers/Base64.js, but the browsers I have tested on already has window.atob.
What is Expected?
Get the fcm token.
What is actually happening?
It throws error:
Points to this function in firebase-messaging.modern.js: