#Notification Panel

21 messages · Page 1 of 1 (latest)

golden pecan
#

Bro in my application I will send notifications if It was in notification panel how to configure it if I click notification in windows panel it have to open the app instead it is clearingnotification.on('click', () => {     if (win === null) {       createWindow();     }      else if (win && !win.isVisible()) {       win.show();     }     else if(win && win.isVisible()) {       win.show();     }      else {       if (win)         win.show();     } })   notification.show();   lastNotification = notification } 

outer laurel
#

what's the point of these two else if if they do that same as the else?

#

oh it's a third else if lol

golden pecan
#

Okay bro I'll remove it but the issue is how to open notification in windows panel bro if click the notifications it is clearing in Notification panel but I want it to open my app thats my issue

outer laurel
#

don't call me "bro" please

#

how do you init the notification?

#

Do you see a console.log if you try this?

const notification = new Notification({ title: "Test Title", body: "Test Body" });

notification.on('click', (event, arg) => {
  console.log("clicked");
});

notification.show();
golden pecan
#

Bro my above functions are working clearly but I want to know how to open my app notification in windows panel

#

@outer laurel

outer laurel
#

stop calling me bro

golden pecan
#

Okay

#

Please help

#

@outer laurel

outer laurel
#

what's your window config?

#

The show() should work if your window is created and hidden. Maybe you can try to add an event.preventDefault();

golden pecan
#

Not working

#

@outer laurel

#

Hey how to add title icon on notifications @outer laurel

warm ferry
#

Please don't ping people repeatedly to answer your questions @golden pecan

#

Have you tried the icon option in the constructor?