GWT Desktop-Notification

1,055 views
Skip to first unread message

Marcel K

unread,
Feb 7, 2014, 3:26:29 AM2/7/14
to google-we...@googlegroups.com
Hey,

after some coding with gwt i want to publish a component that i wrote. It's an api for desktop-notification and should work with Chrome, FF and Safari (according to https://developer.mozilla.org/en-US/docs/Web/API/notification#Browser_compatibility).

I would really appreciate if someone could take a look at it and maybe give me some advices ;) or.. maybe even use :)



Cheers
Marcel

ant...@gmail.com

unread,
Feb 7, 2014, 8:34:04 AM2/7/14
to google-we...@googlegroups.com
Marcel that is cool & interesting

We'll give it a go once time allows...
Why don't you post some screenshots or deploy a sample web app ( on appspot.com ) so that people can see it in action ?

Antonis
Message has been deleted

JoyaleXandre

unread,
Feb 8, 2014, 2:33:12 AM2/8/14
to google-we...@googlegroups.com
Really interesting. I'll see what I can do with it in our project.

Thanks! :-)

On Friday, February 7, 2014 10:23:40 AM UTC-5, Marcel K wrote:

Alain Ekambi

unread,
Feb 8, 2014, 4:09:28 AM2/8/14
to google-we...@googlegroups.com
Do I need to enable something in Chrome ? 


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Marcel K

unread,
Feb 8, 2014, 7:06:15 AM2/8/14
to google-we...@googlegroups.com
To active it as a user:


If you are a developer and want to use it, check out the sample code:


Hope it helps ;)


Am Samstag, 8. Februar 2014 10:09:28 UTC+1 schrieb Alain:
Do I need to enable something in Chrome ? 
2014-02-08 8:33 GMT+01:00 JoyaleXandre <joyale...@gmail.com>:
Really interesting. I'll see what I can do with it in our project.

Thanks! :-)


On Friday, February 7, 2014 10:23:40 AM UTC-5, Marcel K wrote:

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsub...@googlegroups.com.

Marcel K

unread,
Feb 8, 2014, 11:23:31 AM2/8/14
to google-we...@googlegroups.com

Andrew Mackenzie

unread,
Feb 9, 2014, 9:21:39 AM2/9/14
to google-we...@googlegroups.com
I'll try and find time to look at it. I developed a GAE/GWT component that abstracts "push" to users, using GCM to Android devices and Channels API (gae) to web users, with a GWT component that receives the "push" notification.

Andrew Mackenzie

unread,
Feb 9, 2014, 9:21:39 AM2/9/14
to google-we...@googlegroups.com

JoyaleXandre

unread,
Mar 26, 2014, 2:57:54 PM3/26/14
to google-we...@googlegroups.com
Hi!

I've finally tried your lib and it worked fine. The only problem I have is with the duration. I can't modify it. It seems to be hardcoded to 5 seconds. Even in your appspot example the duration is only 5 seconds.
I want to have a notification that stays there until the user click the X button.

Can you help please?

Marcel K

unread,
Mar 26, 2014, 3:13:38 PM3/26/14
to google-we...@googlegroups.com
Hey,

the notifications are closing manually via timer. I just tested the example and it works here fine with different durations.
which browser are you using?

JoyaleXandre

unread,
Mar 26, 2014, 3:19:19 PM3/26/14
to google-we...@googlegroups.com
I was using FireFox. In Chrome, it works well. As expected it's not even supported in IE.

Marcel K

unread,
Mar 26, 2014, 3:51:27 PM3/26/14
to google-we...@googlegroups.com
For me it works in FF with durations < 4sec.. looks like FF closes notifications automatically if they are not closed manually before.
Can you confirm that it works for times < 4sec?

Alexandre Joyal

unread,
Mar 26, 2014, 4:25:31 PM3/26/14
to google-we...@googlegroups.com
You're right. Strange behavior. It's a feature killer for me.


--
You received this message because you are subscribed to a topic in the Google Groups "Google Web Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/SK_SLvVieCE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Marcel K

unread,
Mar 26, 2014, 5:31:42 PM3/26/14
to google-we...@googlegroups.com
Im sorry to hear that. 

Maybe Mozilla will change this, but i dont think so.
To unsubscribe from this group and all its topics, send an email to google-web-toolkit+unsub...@googlegroups.com.

Rob

unread,
Mar 28, 2014, 11:53:35 AM3/28/14
to google-we...@googlegroups.com
That looks good, however you might want to look into multi monitor support. With my browser open on Screen 2 (Windows 7 PC, Chrome) the notification window pops up on Screen 1.

Rob

confile

unread,
Jan 12, 2016, 8:01:38 PM1/12/16
to GWT Users
@Marcel There are two things missing in you GWT project: 

1. How do you set the duration the notification is shown?
2. How do you get the notification id from a click on the notification to make a proper redirect?

Marcel K

unread,
Jan 30, 2016, 9:11:05 PM1/30/16
to GWT Users
Hey,

1. Simply use a timer to call close() on the notification. Thats the way it's done in JS.
2. I updated the code for you. The Notification is now available in the event, so you can access the properties you set before.
It is also updated to the latest spec.

I hope it helps you ;)

Ric

unread,
Nov 1, 2016, 2:31:34 PM11/1/16
to GWT Users
Hey Marcel,

Your project works fine with Chrome desktop but now Chrome mobile seems to require Service Workers to send notifications.

I have tried to implement it based on examples, it works with simple html projects but when I try to register a serviceworker from a GWT project I get the following error: Failed to register a ServiceWorker: No URL is associated with the caller's document

if ('serviceWorker' in navigator) {
   navigator
.serviceWorker.register('sw.js');
   navigator
.serviceWorker.ready.then(function(registration) {
      registration
.showNotification(title,
         
{ body: body, icon: icon }
     
);
   
});
}

Have you updated your project or may be have you more experience with serviceworkers?

Thanks,
Ricardo

vitrums

unread,
Nov 7, 2016, 12:17:00 PM11/7/16
to GWT Users
On my taste package-by-feature strategy is more concise and generally more on point, than package-by-layer. In your case I would gather all event classes under client.event and have an inner static class named Handler for each corresponding NotificationSomethingEvent (just like the modern events in gwt). Therefore clients would call something like addHandler(new NotificationClickEvent.Handler(){...}, NotificationClickEvent.getType());
Reply all
Reply to author
Forward
0 new messages