-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
webkit desktop notification #1951
Conversation
#if defined(OS_MACOSX) | ||
singleton_ = new NotificationManagerMac(); | ||
#elif defined(OS_WIN) | ||
singleton_ = new NotificationManagerWin(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation is not consistent in this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry about that, I use Xcode and Vstudio, apparently Xcode uses space, Vstudio uses tab
@jtg-gg It looks gorgeous! 👏 |
@jtg-gg Thanks! |
The indentation and spaces/tabs are all over the place, I do believe node-webkit uses google code style so 4 spaces. |
You should make a placeholder for linux. |
That's for the contribution. It's cool. However, Linux support should be added before it can be merged into master. See also https://groups.google.com/d/msg/node-webkit/W261vvrL2jo/61H23GY2PZkJ |
@rogerwang , I'll fix the indent ( i just wondering, is 2 spaces or 4 ?) and make the place holder for linux |
it's 2 spaces in this repo. A place holder might help passing build but it's not real implementation, which should be done before merging into master. Or we'll break the cross-platform promise. I can look into the linux support after 0.10 release. |
ok thx @rogerwang I've commit the 2 spaces indentation fix and the linux placeholder (i haven't compile it as I don't have linux platform yet) |
Given the fact that "Linux" has no unified desktop notification system it might be necessary to define exactly what you mean when you say Linux support. Ubuntu? Gnome? KDE? All 3? At least one of them? All 800 window managers you can possibly find? Do you require a workaround for WMs that don't have native desktop notifications? What exactly is the scope here? |
sorry my bad, is it TOOLKIT_GTK for the linux platform ? |
@jtg-gg: If you mean me, I was asking the project lead for clarification, not you :) |
@hachre we're not trying to define this. We'll follow upstream. |
I'll take a look at Linux tonight/tomorrow. |
@jtg-gg I am not in a state to build and test this code myself, can you please provide me the binary (that you might already have) for windows? |
@dufferzafar I've just made a release here https://github.com/jtg-gg/node-webkit/releases/tag/nw-v0.9.2-jtg-gg |
@jtg-gg Thanks a ton 😄 |
@jtg-gg does that include your setBadgeLabel code as well? |
@mephux Yes it does include the setBadgeLabel code |
@jtg-gg Have you thought about adding support for the new Windows 8/8.1 notifications using the Windows.UI.Notifications shown in the top right corner of the screen? That might be useful if the app isn't providing a system tray icon and if targeting the newer OS. |
@rogerwang could you please make sure this is added in nw 0.10.0 it is such an essential part! Even if it is only for OSX and Windows. Please merge asap! |
Currently I use this on Mac, works great!
|
@jtg-gg The release you've supplied for windows does not work. This is the error I get when trying to execute
|
@octalmage not sure how that would be a replacement for native notification support? How do you handle on click events? |
@mephux Personally I only need to alert the user so for me it's a good work around until native notification support is implemented. |
@dufferzafar Are you sure you copied the nwsnapshot.exe and the *.dll's from an existing 0.9.2 build? @jtg-gg didn't ship all the files for Windows so you have to copy them yourself. Hope this helps! |
@jamesmortensen Thanks. That worked :) |
@jtg-gg Thank you very much for the awesome work. I have a problem which I want to confirm whether belongs to Chromuium or node-webkit. So I'll try with the Chromium 35.0.1916.113. Does the notifications addon compatible with the v0.10.0-rc2? Is that possible to make one release, if yes it'll be very helpful, thank you! |
Hi @sishen , @rogerwang will try to update, might need lots of works on my side |
@jtg-gg That looks great! Thank you for all your efforts. |
@jtg-gg I found that upstream uses Balloon notification on Linux, similar with what you are using on windows, could your impl be based on that? see https://github.com/rogerwang/chromium.src/tree/nw/chrome/browser/ui/gtk/status_icons |
Squashed commits: [b3c450f] [Notification] handle empty body on windows (+1 squashed commits) Squashed commits: [ca3f634] [Notification] fix compiler error. missing base:: (+1 squashed commits) Squashed commits: [af8b22b] [Notification]fix compile error on linux (+1 squashed commit) Squashed commits: [32bc400] compile error fix (+1 squashed commit) Squashed commits: [2955c46] [linux] notification implementation (+1 squashed commit) Squashed commits: [edb7e83] [WIN] make the StatusTray a singleton, check for the StatusIcon if it has been created before, handle the destruction of StatusIcon and StatusObserver properly (+1 squashed commit) Squashed commits: [3a1f53b] [Linux] add placeholder for the desktop notification (+7 squashed commits) Squashed commits: [f784e4a] indentation and formatting fix [c5ef03d] fix the indentation [d1662e7] [MAC] add version check for the notification image, since it only supported by Mavericks [18b2d38] [WIN] fix notification manager compile warnings (missing OVERRIDE) [00177bb] [MAC] implement loading / showing image from url for desktop notification [e8b8cce] fix compile warning for undefined constructor [a3d73b2] Move notification image download callback to the parent class, preparation for MAC notification custom icon implementation (+1 squashed commit) Squashed commits: [ee010e2] [WIN] implement the icon image display from URL (+8 squashed commits) Squashed commits: [4844475] [MAC] implement desktop notification, display event dispatcher [4c5f445] Remove unnecessary comments [af4bd7e] Implement notification events dispatcher (close, display, error) [d6662bc] [WIN] implement windows balloon tray notification, with application icon as the tray icon [19c8965] [WIN] AddDesktopNotification, CancelDesktopNotification function prototype adjustment with NotificationManager [29816f5] [WIN] implement windows notification [7191831] [MACOSX] implement desktop notification event handler (send the click back to java script) implement "CancelDesktopNotification" [c5b359d] add notification manager (nw_notification_manager) for desktop notification implement MacOS notification manager
@rogerwang I've updated the pull request to build 0.10, now it includes linux implementation. However I've looked for the possibility to do linux balloon notification, however it needs lots of works, the tray implementation is broken for ubuntu, needs lots of customisation. hence I keep the libnotify implementation this pull request will need the chrome source code modification, here https://github.com/rogerwang/chromium.src/pull/12 |
nice work! |
太棒了 |
Implement webkit dekstop notification (with image url and event dispatcher for click, close, display, error to javascript)
currently only implemented for Windows and MAC
the windows version will need some chrome source modification, I've made the pull request here:
https://github.com/rogerwang/chromium.src/pull/12