Skip to content

Commit

Permalink
fix FCM service worker setup code
Browse files Browse the repository at this point in the history
Update the FCM service worker setup code to work with >=7.0.0 Firebase JavaScript SDK.

https://firebase.google.com/support/release-notes/js#version_700_-_september_26_2019
  • Loading branch information
aviaryan committed Feb 25, 2020
1 parent 1e5049c commit 4152991
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions messaging/firebase-messaging-sw.js
Expand Up @@ -19,9 +19,12 @@ const messaging = firebase.messaging();
importScripts('https://www.gstatic.com/firebasejs/7.9.1/firebase-messaging.js');
// Initialize the Firebase app in the service worker by passing in the
// messagingSenderId.
// apiKey, projectId, messagingSenderId and appId values.
firebase.initializeApp({
'messagingSenderId': 'YOUR-SENDER-ID'
'apiKey': 'YOUR-API-KEY',
'projectId': 'YOUR-PROJECT-ID',
'messagingSenderId': 'YOUR-SENDER-ID',
'appId': 'YOUR-APP-ID'
});
// Retrieve an instance of Firebase Messaging so that it can handle background
Expand Down

0 comments on commit 4152991

Please sign in to comment.