MyBB Community Forums

Full Version: GCM Push Notifications to Chrome on Android/Windows/ChromeOS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
GCM Push Notifications

Links: MyBB Extend, GitHub

This plugin for MyBB pushes notifications via Google Cloud Messaging to Chrome after a post is made to a user's subscribed thread or a user receives a private message. This doesn't require any additional apps and works even if your browser is closed, which is great for mobile platforms.

Please see GitHub for demo, installation instructions, bug reports, and more information.

Requirements
  • MyBB 1.8x hosted over HTTPS
  • Chrome 45+ on Windows, Android or Chrome OS

[Image: desktop.png]

[Image: android.png]



Feature walkthrough (featuring Respond theme)

After signing into your forum, your users will be given the option to get push notifications for subscribed threads and private messages.

[Image: walkthrough-allow.gif]



Users receive a push notification when someone else posts to their subscribed threads.

[Image: walkthrough-new-thread.gif]



Users receive push notifications when they receive a private message. (see it in action)

Push notifications update for multiple new posts or updated threads. (see it in action)

Users can receive push notifications on multiple devices and manage options from the UserCP > Edit Options. (see it in action)

If a user declines to receive push notifications, they will not be asked again for 30 days. (see it in action)



Download (GitHub) (MyBB Extend)



If you like my work, feel free to buy me a coffee.
Would be awesome to be able to use non-HTTPS sites. Otherwise I can't even test Sad

Seems nice nonetheless.
(2015-06-09, 06:21 AM)Omar G. Wrote: [ -> ]Would be awesome to be able to use non-HTTPS sites. Otherwise I can't even test Sad

Seems nice nonetheless.

Thanks for the feedback.

This plugin depends on a service worker, which require secure origins to ensure that the service worker script is from the intended origin. Currently, this means using HTTPS on live sites, though localhost will work during development.

If you want, you can get a free SSL certificate. This is what I did.
(2015-06-09, 07:26 AM)Marc A Wrote: [ -> ]If you want, you can get a free SSL certificate. This is what I did.

The free SSL has problem. Can you visit this webpage? https://auth.startssl.com/

What happens if I don't have SSL? Errors will arise?
(2015-06-09, 03:17 PM)XP Mai Wrote: [ -> ]
(2015-06-09, 07:26 AM)Marc A Wrote: [ -> ]If you want, you can get a free SSL certificate. This is what I did.

The free SSL has problem. Can you visit this webpage? https://auth.startssl.com/

What happens if I don't have SSL? Errors will arise?

When I visit that page, I am prompted to select my certificate which I generated for my site. You will have to select your certificate. If you are having issues, perhaps you should try starting again and following the instructions more closely.

Again, this plugin depends on a service worker. A service worker is like a little web app that runs in the background of Chrome. The service worker handles push notification requests from the plugin. Any requests from unsecure sources will be ignored.
Since HTTPS seems to be a barrier, I have setup a demo forums (see OP for more details). You can use this forum to try out this plugin. If you'd like to help with development, please let me know and I can give you access to this demo forum.
Just added device management to the plugin. Now you can push notifications to multiple devices and manage those subscriptions.
Added some MyBB settings so now the plugin should be easier to install.
You should consider something like PluginLibrary to manage your settings.

Also, you will find the first setting to be redundant with administrators being able to simply deactivate the plugin.
(2015-06-13, 05:27 AM)Omar G. Wrote: [ -> ]You should consider something like PluginLibrary to manage your settings.

Also, you will find the first setting to be redundant with administrators being able to simply deactivate the plugin.

I'll look into PluginLibrary, but I basically only have 2 settings and I don't think I'll need more. The plan is to offer more settings to the individual user instead, like whether or not to receive push notifications for posts, PMs, or mentions, etc. I don't know how to do this yet though.

Yes, you're right. The first setting is redundant. I will remove it in a later build.

Thanks for the input.

Did you get a chance to actually try the plugin, or are you just looking at the code?
Pages: 1 2 3