Provide option to Archive email from Notification. Similar lo apple mail, where it has Trash & Reply options.
Ahh man this would be really cool. Right now, N1 uses Chrome's "web notifications" APIs to do notifications on Mac and Linux. I think that supporting "Quick Actions" on Mac OS X will require integrating with the native Notification Center APIs, but we should be able to do that. If you're interested in working on it, we'd love a pull request! One option would be to use a native node module to access the Mac OS X APIs. Another option might be this project: https://github.com/TooTallNate/NodObjC
I've added this to our open source project roadmap for folks that want to +1: https://trello.com/c/lVdzE5tc/30-quick-actions-from-new-mail-notifications-mac-os-x
Hi @Harishwar — just to follow up, we've added the "Reply" option to notifications and it'll be in the upcoming release. (0.3.21+) Unfortunately, the "Archive" button and other actions are actually done with private APIs on Mac OS X, so we can't copy that behavior!
@bengotow, curious, if N1 isn't being distributed through the Mac App Store, why not use private APIs? Because they're more volatile?
@bengotow, I took a look at NSUserNotifcation. It looks like we could assign "archive" to the actionButtonTitle and leave hasReplyButton set to true. There's even an option to add another button using otherButtonTitle.
Is there something I'm missing? Would you like a PR?
This is possible. I know that Electron and Chromium use some private API's on OS X because they can and remove them in their MAS builds.
_This message is of my own opinion._
If you can get it working, restrict it to verified versions of OS X, _and_ restrict to OS X only, submit a PR. This would be a cool feature for many. It would be cool if I could get something like this working on Linux.
I think it'd be a relatively trivial feature to implement. But since the reply-via-notification feature is currently the only card in the Development list of the Trello board, I'm curious to see where the code that's being worked on is...
They are also working on Calendar integration, since they pushed to the calendar branch recently.
Hey! Sorry for the delay folks. There's been further discussion about this over on the Electron repo: https://github.com/atom/electron/issues/4424
The tldr is that N1 does not use Apple's notification APIs directly. It potentially /could/, via NodObjC, but we tried that with an older version of Electron it caused the app to crash intermittently.
When N1 says new Notification(..., it calls a WebKit method in libchromiumcontent, which eventually gets handled by Electron's brightray wrapper around Chromium: https://github.com/atom/brightray/blob/master/browser/mac/cocoa_notification.mm#L1.
I've made some progress on https://github.com/atom/electron/issues/4424 (at least the Mac OS X portion) - hopefully this will be getting fixed soon.
Sometimes it would definitely be nice if N1 was just a regular Mac app!
@bengotow But then all the Linux users (including myself) would not be able to use N1!
I wonder whether there’s a way to produce notifications like the ones from Messages.app, where clicking the Reply button on the notification reveals an integrated text box for typing a quick reply.
Most helpful comment
@bengotow, I took a look at
NSUserNotifcation. It looks like we could assign "archive" to theactionButtonTitleand leavehasReplyButtonset totrue. There's even an option to add another button usingotherButtonTitle.Is there something I'm missing? Would you like a PR?