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

feat: On macOS, Closing Notifications Triggers the 'close' Event #13306

Merged

Conversation

sidneys
Copy link
Contributor

@sidneys sidneys commented Jun 19, 2018

🤷🏽‍♂️ Previous Behaviour

On macOS, notifications created via ´Electron.Notification´ module do not emit the close event when closing them via the "Close"-button.

🤷🏽‍♂️ Screenshot

screen shot 2018-06-19 at 22 33 08

🎯 New Behaviour

When clicking the "Close" button, Notifications created via ´Electron.Notification´ now emit the expected close event. This is supported by both Alert- and ´Banner´-style notifications, and also works when dismissing multiple notifications at the same time.

@sidneys sidneys requested a review from a team June 19, 2018 20:32
@welcome
Copy link

welcome bot commented Jun 19, 2018

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix, OR prefix at least one of your commit messages.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@sidneys sidneys changed the title feat: macOS Support for the Notification ´close´ Event feat: macOS Support for the Notification 'close' Event Jun 19, 2018
@sidneys sidneys changed the title feat: macOS Support for the Notification 'close' Event feat: On macOS, Closing Notifications Triggers the 'close' Event Jun 19, 2018
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

Using these APIs will prevent MAS apps being added to the store (using private apis is against MAS rules).

Can you wrap the notification center delegate code with if not defined checks for MAS please.

@sidneys sidneys force-pushed the notification-close-event-macos branch from f026da9 to 63c209e Compare June 20, 2018 16:53
@sidneys
Copy link
Contributor Author

sidneys commented Jun 20, 2018

@MarshallOfSound

I wrapped both calls inside #if !defined(MAS_BUILD) calls.

Cheers,
S

@sidneys
Copy link
Contributor Author

sidneys commented Jun 25, 2018

Dear @MarshallOfSound
Dear @electron/notifications

are the changes i added enough to satisfy the MAS requirements?

Kind regards
S

@sidneys sidneys force-pushed the notification-close-event-macos branch from 63c209e to 4a77cf5 Compare June 25, 2018 04:50
@MarshallOfSound MarshallOfSound added the semver/minor backwards-compatible functionality label Jun 25, 2018
@sidneys sidneys force-pushed the notification-close-event-macos branch from 4a77cf5 to 1c56284 Compare July 2, 2018 07:31
@MarshallOfSound MarshallOfSound merged commit 23541b5 into electron:master Aug 13, 2018
@welcome
Copy link

welcome bot commented Aug 13, 2018

Congrats on merging your first pull request! 🎉🎉🎉

@sidneys
Copy link
Contributor Author

sidneys commented Oct 17, 2018

That's awesome. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/minor backwards-compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants