Sponge Notification API - Desktop Notifications

What is this?
This API allows you to send notifications to any user that has the notification extension installed.They don’t have to be on the server. This is still a huge WIP and nothing is public yet and code has yet to be uploaded to GitHub. In this example I’ve written a simple /requestadmin command, which is the desktop variant of Essentials’ /helpop command.

Preview

Example uses:

  • Request staff members on the server (as seen in the video)
  • Integrate some kind of PM system outside minecraft
  • Get notified when somebody get’s banned
  • Factions (get notified when you’re getting raided)
  • Get notified when your server is offline (as shown in the video)
  • Buycraft notifications
  • Determining if a player should be allowed to join a whitelisted server. (Allow, or kick with predefined message.)
  • The server has crashed, would you like to bring it back online? (May not be possible.)
  • A player has been banned by a new moderator that you may not trust, should we go through with this ban?

How is this done?
I’ve been working on a simple API that connects a chrome extension to your Minecraft server through web-sockets so you can receive notifications even when you’re not online on your server. In the video, I’m using running Craftbukkit (Spigot) and a plugin compiled with the Bukkit API (planning to port to Sponge) and the WebSocket client made by TooTallNate
.

Do you guys have any suggestion/opinions on this? Would you guys use this, and if so, about what would you want to get notified? :smile:

17 Likes

I would also opt for email or sms notification, so I could take action from my phone.

2 Likes

I love this idea. It just goes to show you how infinitely expandable Minecraft modding really is.

EDIT:
The video also seems to have a bad source. Error: “the video you have requested is unavailable”.
Nevermind :wink:.

Video looks great, better than I imagined it to be.

2 Likes

@kuro_chou
That would be an interesting feature which I’ll definately look into in, but that would involve using an SMS service, which isn’t free (in most cases). You’d have to pay a couple of cents for each 10 msg’s or so.

@Treblue
Thanks for telling me, I fixed the video now.

Most major carriers actually have a free email to sms function.
That is, your server would send free smtp email to [playerPhone]@[carrierEmail].com, and they send the SMS for you.
Something to look into. :smile:

1 Like

Maybe the API should allow the user to respond directly to a request/message within the chrome app itself.

A “Reply” button in the notification box, perhaps?

Yeah I’ve been planning that. The issue is that there isn’t a textbox in Chrome’s Notification API (there is support for buttons if you’d look at https://developer.chrome.com/apps/richNotifications). If that’s requested a lot, I might add a popup that allows for text input :slight_smile:

1 Like

How about custom action buttons that don’t require any input within the API?

These could be things like:

  • Determining if a player should be allowed to join a whitelisted server. (Allow, or kick with predefined message.)
  • The server has crashed, would you like to bring it back online? (May not be possible.)
  • A player has been banned by a new moderator that you may not trust, should we go through with this ban?

Basically a ton of “yes or no” type questions.

1 Like

That’s a good idea, I’ll add that to the list. I’ve had a couple of these in mind already

1 Like

I really like the idea of using a chrome extension and websockets to ‘hijack’ the desktop notifications, that’s super neat. You probably want to use twilio for SMS which costs only $0.0075 per message; it would cost around $30/mo to send 4000 messages. I could see you turning this into a service of some kind.

2 Likes

That’s really neat. Great work!

Here are some thoughts if you want to pursue this idea further to turn it into a service.

  1. Yes, websockets are really neat but server owners won’t want to use them because they take up bandwith(and servers are sometimes charged based on that). Seeing as how push notifications are pretty much one way, there’s no need for bi-directional communication and, in consequence, web sockets are not needed. Instead have your service available from a webhook endpoint so that plugins can make HTTP requests instead.

  2. If you wish to move on to other notification delivery systems(ios, android, growl, etc) you’re going to need an intermediary that can store and deliver them. I would code up a server with the above-mentioned webhook as well as configurable delivery systems for the future, this could even be offered as a SaaS.

  3. If you go the SaaS route, you can have a Sponge plugin that provides a simple Java API to post notifications so that plugins don’t have to manually create http requests. How cool would it be if a plugin developer could do:

     Notification.push(players, new TextNotification("Requested from ..."));
    

    The possibilities are pretty much endless this way, for plugins and for server owners.

4 Likes

Great ideas
Anyway nice plugin Ivan, this is going to be one of the ones going on my server
EDIT: where is the bukkit version? I wish to use it NOW

Love the idea!

Might use it or do a fork (If I’m allowed) of it.

Any suggestions on what language I should use on the backend? node.js, PHP, Java…? I really like the SaaS idea though!

Whatever you feel most comfortable with is best for now. There isn’t any crazy optimizing that has to be done, so it’s basically up to your taste.

I think this is an excellent idea! Honestly. :smile:

Great! This looks like something really helpful!

This is an original idea. Do you know what I say about original ideas?

GO FOR IT!

4 Likes

I’m totally up for turning this in a service but I’m not sure if there would be a lot of people requesting this? Do you have any idea if there would be a lot of interest?