8000 Use single quote to match QS style · mlchiang/quickstart-js@b2ee647 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2ee647

Browse files
committed
Use single quote to match QS style
1 parent eb4cefc commit b2ee647

File tree

2 files changed

+233
-265
lines changed

2 files changed

+233
-265
lines changed

messaging/firebase-messaging-sw.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Import and configure the Firebase SDK
22
// These scripts are made available when the app is served or deployed on Firebase Hosting
33
// If you do not serve/host your project using Firebase Hosting see https://firebase.google.com/docs/web/setup
4-
importScripts("/__/firebase/7.23.0/firebase-app.js");
5-
importScripts("/__/firebase/7.23.0/firebase-messaging.js");
6-
importScripts("/__/firebase/init.js");
4+
importScripts('/__/firebase/7.23.0/firebase-app.js');
5+
importScripts('/__/firebase/7.23.0/firebase-messaging.js');
6+
importScripts('/__/firebase/init.js');
77

88
const messaging = firebase.messaging();
99

@@ -15,8 +15,8 @@ const messaging = firebase.messaging();
1515
// Give the service worker access to Firebase Messaging.
1616
// Note that you can only use Firebase Messaging here, other Firebase libraries
1717
// are not available in the service worker.
18-
importScripts('https://www.gstatic.com/firebasejs/7.12.0/firebase-app.js');
19-
importScripts('https://www.gstatic.com/firebasejs/7.12.0/firebase-messaging.js');
18+
importScripts('https://www.gstatic.com/firebasejs/7.23.0/firebase-app.js');
19+
importScripts('https://www.gstatic.com/firebasejs/7.23.0/firebase-messaging.js');
2020
2121
// Initialize the Firebase app in the service worker by passing in
2222
// your app's Firebase config object.
@@ -38,23 +38,21 @@ const messaging = firebase.messaging();
3838
// [END initialize_firebase_in_sw]
3939
**/
4040

41+
4142
// If you would like to customize notifications that are received in the
4243
// background (Web app is closed or not in browser focus) then you should
4344
// implement this optional method.
4445
// [START onBackgroundMessage]
45-
messaging.onBackgroundMessage(function (payload) {
46-
console.log(
47-
"[firebase-messaging-sw.js] Received background message ",
48-
payload
49-
);
50-
46+
messaging.onBackgroundMessage(function(payload) {
47+
console.log('[firebase-messaging-sw.js] Received background message ', payload);
5148
// Customize notification here
52-
const notificationTitle = "Background Message Title";
49+
const notificationTitle = 'Background Message Title';
5350
const notificationOptions = {
54-
body: "Background Message body.",
55-
icon: "/firebase-logo.png",
51+
body: 'Background Message body.',
52+
icon: '/firebase-logo.png'
5653
};
5754

58-
self.registration.showNotification(notificationTitle, notificationOptions);
55+
self.registration.showNotification(notificationTitle,
56+
notificationOptions);
5957
});
60-
// [END onBackgroundMessage]
58+
// [END onBackgroundMessage]

0 commit comments

Comments
 (0)
0