Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make notifications stay in the Notification Center on macOS #504

Merged
merged 9 commits into from
Oct 11, 2018
Merged

Make notifications stay in the Notification Center on macOS #504

merged 9 commits into from
Oct 11, 2018

Conversation

janosorcsik
Copy link
Contributor

Fixes #317

@sindresorhus
Copy link
Owner

It's not clear why you have reimplemented notifications in the main process. Can you explain your changes?

@janosorcsik
Copy link
Contributor Author

The messenger.com use the HTML5 Notification API. I guess this differs from Electron Notification because the notification does not stay in the Notification Center.
You mentioned the Goofy App in #298 and I found this solution in it.

@sindresorhus
Copy link
Owner

I think you missed by suggested solution there though:

We don't control the notifications, but we could monkey patch Notification in the renderer (browser) process and detect when new notifications are emitted, then send them to the main process, and use the Electron Notification API which supports "reply".

@janosorcsik
Copy link
Contributor Author

Ok. Thank you.
I am going to try monkey patch but I am not an advanced JS developer. Therefore I cannot say this will be fast.
Do you have any suggestions?

@sindresorhus
Copy link
Owner

@janosorcsik Is this ready to be reviewed?

@janosorcsik
Copy link
Contributor Author

@sindresorhus Yes, it is.
Otherwise, I got a PR in my fork. We discussed the reply function.
Please check it out.

sindresorhus and others added 3 commits September 19, 2018 17:22
…into notification

* 'notification' of https://github.com/janosorcsik/caprine:
  Catch notification in the renderer and send to the main process
  Fix lint errors
  Notifications don't show up in the Notification Center on macOS #317
sindresorhus added a commit that referenced this pull request Oct 2, 2018
@sindresorhus
Copy link
Owner

sindresorhus commented Oct 4, 2018

This works well. Nice work! And sorry for the delay.

@sindresorhus
Copy link
Owner

Would you be able to add a click action to the notification so when it's clicked it opens the correct conversation?

@janosorcsik
Copy link
Contributor Author

@sindresorhus Everything is done :)

@@ -0,0 +1,30 @@
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add unrelated files.

@sindresorhus sindresorhus changed the title Notifications stay in the Notification Center on macOS Make notifications stay in the Notification Center on macOS Oct 11, 2018
@sindresorhus sindresorhus merged commit 86bf1d0 into sindresorhus:master Oct 11, 2018
@sindresorhus
Copy link
Owner

Really nice work on this, @janosorcsik 🎉

@janosorcsik janosorcsik deleted the notification branch October 28, 2018 17:43
piomar123 pushed a commit to piomar123/caprine that referenced this pull request Dec 20, 2018
piomar123 pushed a commit to piomar123/caprine that referenced this pull request Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants