Additional firebase testing updates.
This commit is contained in:
@@ -42,3 +42,8 @@ self.addEventListener("notificationclick", function (event) {
|
||||
// ...
|
||||
console.log("SW notificationclick", event);
|
||||
});
|
||||
|
||||
self.addEventListener("message", (message) => {
|
||||
console.log("Push from SW", message);
|
||||
// registration.showNotification("Push from SW" + JSON.stringify(message.data));
|
||||
});
|
||||
|
||||
@@ -130,6 +130,13 @@ export default class AppContainer extends Component {
|
||||
navigator.serviceWorker.addEventListener("message", (message) => {
|
||||
console.log("Comp Did Mount", message);
|
||||
notification["info"]({ message: JSON.stringify(message.data) });
|
||||
navigator.serviceWorker
|
||||
.getRegistration()
|
||||
.then((registration) =>
|
||||
registration.showNotification(
|
||||
"Comp Did" + JSON.stringify(message.data)
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,13 @@ exports.sendNotification = (req, res) => {
|
||||
// const { ids } = req.body;
|
||||
// const url = cloudinary.utils.download_zip_url({ public_ids: ids });
|
||||
|
||||
//Prod
|
||||
// var registrationToken =
|
||||
// "c3-6vUcehzdDe4rdfUr1JP:APA91bEbZiO1j7M4O1IHzWEiczqNoT7udFH9wE7m-Ob-2wRRRxEv6gyBY64fYVvFkfOGdLNJic6kcAr7ImpUy3jHXlWvUqtdUQ-uRhZoWa-IgJSCIgfT7pjDnvCakvr45YyAms4neP1s";
|
||||
|
||||
//Dev
|
||||
var registrationToken =
|
||||
"dwsrcoeaIpwEmSzrVkE-_V:APA91bFurr0yCN-yXcaNrJvn8_f47I4vb4avxeS0NR5SCBPNADFB-gC79Hdmj7wqPccPmZCx0NzA_Dqi1lLYegpN-tFvANaK9I00oOSsFnOxv6KNZDLW0WguwFA0vQN8X50BaGuLTQqM";
|
||||
|
||||
var message = {
|
||||
data: {
|
||||
title: "850",
|
||||
|
||||
Reference in New Issue
Block a user