Open
Description
Describe your environment
- Operating System version: Android 11
- Browser version: Firefox for Android 90.1.1
- Firebase SDK version: 8.7.1
- Firebase Product: Cloud Messaging
Describe the problem
In Firefox for Android when trying to get the messaging token it crashes with the following error:
The same code is functional in Chrome (Android, Windows, Ubuntu), Firefox (Windows, Ubuntu) and Edge (Windows).
Steps to reproduce:
- Attempt to get messaging token in Firefox for Android.
Relevant Code:
Main app:
const firebaseApp = firebase.initializeApp({...});
const messaging = firebaseApp.messaging();
const currentToken = await messaging.getToken({
vapidKey: '...',
});
firebase-messaging-sw.js:
importScripts('https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/8.6.1/firebase-messaging.js');
firebase.initializeApp({...});
const messaging = firebase.messaging();
messaging.onBackgroundMessage((payload) => {
console.log(
'[firebase-messaging-sw.js] Received background message ',
payload
);
});