-
-
Notifications
You must be signed in to change notification settings - Fork 92
Closed
Description
Hello,
I use this only for firebase-messaging / handling notifications in my application.
but I found the provider.ts problem: 109 Uncaught FirebaseError: Installations: Missing App configuration value: "projectId" (installations / missing-app-config-values).
which makes it unable to register the default service worker like this screenshot below
the solution I found was to add apiKey projectId appId to the firebase-messaging-sw.js templates like the line of code below.
const version = options.firebaseVersion
const apiKey = options.apiKey // i add this line
const projectId = options.projectId // i add this line
const appId = options.appId // i add this line
const messagingSenderId = options.messagingSenderId
const onFirebaseHosting = options.onFirebaseHosting
if (onFirebaseHosting) {
// Only works on Firebase hosting!
importScripts('/__/firebase/' + version + '/firebase-app.js')
importScripts('/__/firebase/' + version + '/firebase-messaging.js')
importScripts('/__/firebase/init.js')
}
else {
importScripts(
'https://www.gstatic.com/firebasejs/' + version + '/firebase-app.js'
)
importScripts(
'https://www.gstatic.com/firebasejs/' + version + '/firebase-messaging.js'
)
firebase.initializeApp({
apiKey, // i add this line
projectId, // i add this line
appId, // i add this line
messagingSenderId: messagingSenderId
})
}
does this lead to an issue or am I miss configuration?
Metadata
Metadata
Assignees
Labels
No labels
