This commit is contained in:
@ -4,6 +4,7 @@
|
||||
importScripts("https://www.gstatic.com/firebasejs/10.12.0/firebase-app-compat.js");
|
||||
importScripts("https://www.gstatic.com/firebasejs/10.12.0/firebase-messaging-compat.js");
|
||||
|
||||
//من فاير بيز
|
||||
firebase.initializeApp({
|
||||
apiKey: "AIzaSyBZV7KBLRJSTApahfrO8lBesmIM3zNRSaY",
|
||||
authDomain: "sweet-home-b2766.firebaseapp.com",
|
||||
@ -14,6 +15,7 @@ firebase.initializeApp({
|
||||
measurementId: "G-M2V95NBJLX",
|
||||
});
|
||||
|
||||
//ننشئ رسالة
|
||||
const messaging = firebase.messaging();
|
||||
|
||||
// Handle background messages
|
||||
@ -31,6 +33,7 @@ messaging.onBackgroundMessage((payload) => {
|
||||
});
|
||||
|
||||
// Handle notification click
|
||||
//اذا ضغطنا ع الاشعار شو بصير
|
||||
self.addEventListener("notificationclick", (event) => {
|
||||
event.notification.close();
|
||||
const url = event.notification.data?.url || "/";
|
||||
|
||||
Reference in New Issue
Block a user