Question

Well, A small idea of making an application ran through my mind. But this is the first time I would try to make an application. Till now I have worked on PHP, C++, Ruby with Rails frame work, but all at a beginner level.

I am ready to take a bigger leap and learn them extensively if my idea demands so. The requirement is such that the web app gives you a desktop notification. I have seen that happen with a Gmail chat box. All I need to know is, what could be right tools to start with? Does PHP go that far? Or working on Rails would be a better option? Also, is it possible for an average beginner level programmer to do such a thing? What all does it take to make an app like that?

Was it helpful?

Solution

The desktop notification is not language dependant. There is no server-side language that can make a notification appear on a desktop. It doesn't matter what you put on the server, you can't make that code put notifications on the desktop unless the client supports such a notification API.

Client support means there has to be some sort of application running on the client that can put up the notification dialog on the desktop. This is the number one requirement.

If you don't have anything running on the client with such support, then no matter what magic you put on the server (PHP, Ruby, Perl, ...) nothing will ever happen on the client.

That's why, as you see from the answer by KCiebiera, the clients that can make notifications possible are Chrome and Firefox.

What you do is run code on the client (Javascript in this case), that looks for something (a message from the server for example), and then instructs the browser (Chrome or Firefox), to launch the notification.

It's not more complicated than that. Look at the tutorial KCiebiera posted, and that should get you started.

Hope this helps you understand the problem better.

OTHER TIPS

AFAIK desktop notifications are available only in Chrome/Chromium and Firefox browser. There is a working draft http://www.w3.org/TR/notifications/ and also a great tutorial http://www.html5rocks.com/en/tutorials/notifications/quick/ on how to use them. Basically you have to learn a JavaScript API.

What goes on the server-side is irrelevant here, as the notifications happen client-side. Desktop notifications are currently part of a W3C working draft, and are implemented in the current version of Chrome and the next release versions of Firefox, Safari, & IE; see the compatibility table for more details. There are plenty of tutorials out there on how to implement this.

You would have to implement on the server some method that the client-side can use to get (or be pushed) the notifications so that it can display them using the above mentioned API. It doesn't matter if your use Rails, PHP, C++, whatever, they can all do it with enough effort.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top