Open yandiro opened 2 years ago
If you want to utilize this addon, make sure you're using Firebase 8. For Firebase 9, this addon isn't needed because of the modular sdk.
Good to know. So perhaps I should have used Firebase 9 since the beginning.
Anyways, firebase
is globally available, so I could simply call firebase.messaging.isSupported().
But isSupported() is available in firebase 8 too, isn't it? https://firebase.google.com/docs/reference/js/v8/firebase.messaging#issupported
Yes it should be at least based on the docs. If you're following the README
correctly then you should be fine unless it's a Firebase issue itself. I would suggest trying to to see if isSupported
can be accessed from a plain javascript app instead of an Ember just to rule it out.
We import the firebase messaging just like you say:
app.import('vendor/ember-firebase-service/firebase/firebase-messaging.js');
from within the ember-cli-build.
But is this the same file as node_modules/@firebase/messaging
?
@yandiro, it's not. It's essentially the firebase/firebase-message.js
only that it's guarded to not run in non-FastBoot environment. See FastBoot guide.
Note that this is a file that will be generated during build time
But generated from the file in the node_modules, right?
Yes
Anybody ran into this too?
In browsers where messaging is not supported, the browser crashes, so one needs to check for support before initialising messaging by calling messaging()