Forum Moderators: phranque

Message Too Old, No Replies

Push / Notification API tutorial

         

csdude55

4:06 am on Jan 21, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



OK, guys, I'm back to the project I started last year. This SHOULD be so simple, but oh. my. God, it's the most complicated thing ever!

Here's the project: I have people registered on my site, and one of the features is Private Messages. So when they come back to my site (and are logged in), they have a little notification of "You have X unread messages". Just like the PM system on this site, very common.

So, I want to add the step of letting mobile users get a notification on their phone when they get a Private Message. It SHOULD be as simple as sending an email, but is it? Of course not! LOL

Based on earlier discussions, I have these bookmarked:

[notifications.spec.whatwg.org...]
[w3c.github.io...]

But honestly, they might as well be written in Klingon. I think they assume that I already know how to do it, because they clearly leave out Step 1. I feel like I came in on the 10th day of class and missed the important parts. I opened Notepad... now what?

So can you guys recommend a newbie tutorial or anything on how to get started on this process? Like, a step-by-step process on how to send a "Hello world" notification or something to my own phone?

Or, better yet, maybe a Perl module that simplifies it? I searched CPAN for "push" and "notification" and didn't find anything, but of course there might be a different name for it that I simply don't know.

TIA!

phranque

4:52 am on Jan 21, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



So, I want to add the step of letting mobile users get a notification on their phone when they get a Private Message. It SHOULD be as simple as sending an email, but is it? Of course not! LOL


why not?

Email::Sender
http://search.cpan.org/~rjbs/Email-Sender-1.300030/lib/Email/Sender.pm [search.cpan.org]

csdude55

6:47 am on Jan 21, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You misunderstand me, brother. I'm saying that sending an email IS simple, and sending a notification to their phone should be equally simple. But it's not.

csdude55

6:52 am on Jan 21, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I came across HTML5 options, like using:

var notification = window.Notification || window.mozNotification || window.webkitNotification;


(I'm guessing that this would be in a <script> tag, but I really don't know)

Web Notification API
[binpress.com...]

Am I correct in understanding that, in order for this to do what I want, they would have to have their browser open? And, presumably, my site would have to be one of the open tabs? Otherwise, I'm not sure how I would designate who gets what notification.

tangor

4:45 am on Jan 22, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Clarify.

A PM is sent to a mobile user on YOUR site.

The mobile user is NOT logged on and you want to notify them there's a PM on your site without using an email?

csdude55

6:25 am on Jan 22, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Clarify.

A PM is sent to a mobile user on YOUR site.


Correct

The mobile user is NOT logged on and you want to notify them there's a PM on your site without using an email?


Yes and no.

I want them to (have the option to) be notified that they have a message on their phone, which will then send them back to my site to read that message, but without them necessarily having their browser or anything open.

Just like when you get a message on Facebook, Snapchat, or kik. I want them to be sitting in front of the TV or in a restaurant, and their phone lights up or vibrates; then they turn it on, and in the Notification section they have a message that says, "New message on Example.com" (or whatever), which they'll click on and be taken to my site to read the message.

This is by far the most common complaint that I get. People can't understand why they get a notification when someone sends them a message on Facebook, but not on my site. Of course, you and I know that they installed an app for that, but I don't have the multi-million dollar investors to convert my site to an app like ol' Zuckerberg had, and there's just not enough time in the day for me to build it myself. I really can't understand why there's not an easier way.

topr8

11:58 am on Jan 22, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>I want them to (have the option to) be notified that they have a message on their phone, which will then send them back to my site to read that message, but without them necessarily having their browser or anything open.

>>Of course, you and I know that they installed an app for that,

that's your problem though, if their browser isn't open, unless they have installed your app (which you don't have) how are they going to get the notification? ... regular email notification is your only option.

csdude55

11:26 pm on Jan 22, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



that's your problem though, if their browser isn't open, unless they have installed your app (which you don't have) how are they going to get the notification? ... regular email notification is your only option.


I guess that was my question... is there a way? I guess not. One would think that the user could simply provide their cell number, and I could send a notification to that number, but of course nothing is simple anymore.

Failing that, does anyone know of a "universal" app that websites could promote to create this option? If not, then if you're an app builder then it might be something to consider: a single app that would simply link with websites to show notification. Website owners would probably be happy to pay a monthly fee to subscribe rather than spending thousands to rebuild their site into an app.

NickMNS

11:54 pm on Jan 22, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I really do not know much if anything about this. But I saw some stuff about this during the last Google dev conf. I bookmarked it because it looked like it might be useful at some point in the future. Google has Polymer frame work for mobile and web-apps and it offers push notification. Here is a link:
[elements.polymer-project.org...]

Again this is a long shot.

phranque

9:56 am on Jan 23, 2017 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



You misunderstand me, brother.

indeed.

if you don't have an app for proper push notifications then you must depend on other apps for that such as email or text messaging.

or use mobile browser-specific features...

Web Push notifications in Firefox:
https://support.mozilla.org/en-US/kb/push-notifications-firefox [support.mozilla.org]

Web Push Notifications: Timely, Relevant, and Precise  |  Google Developers:
https://developers.google.com/web/fundamentals/engage-and-retain/push-notifications/ [developers.google.com]