Discourse Mobile Push — FCM push notifications for mobile apps

AI-generated summary

Michael_Sandler introduced a new Discourse plugin, discourse-mobile-push, designed to send push notifications to native Android and iOS apps via Firebase Cloud Messaging (FCM). The project was created because the existing discourse-fcm-notifications plugin is outdated and generates warnings on current Discourse installations. Key features include support for multiple devices per user, deep linking to specific topics or posts, automatic cleanup of expired tokens, retry handling for temporary failures, and an optional privacy mode with generic notification content. The plugin acts as a delivery layer, relying on Discourse’s existing system to determine which notifications users receive. Michael_Sandler noted that significant parts of the code were AI-assisted and invited feedback from experienced developers.

In follow-up posts, Michael_Sandler offered to share implementation details for their Flutter wrapper app, specifically for Android. NateDhaliwal suggested joining the @plugin_authors group to post in the appropriate channel, which was subsequently arranged by forumcopilot. Additionally, forumcopilot, who also maintains a Flutter app for Discourse, shared their own approach to push notifications that does not require a plugin installation but lacks immediacy. They expressed interest in potentially adopting Michael_Sandler’s implementation as their user base grows.

I built a new Discourse plugin for sending push notifications to native Android/iOS apps using Firebase Cloud Messaging (FCM).

Why?

The existing discourse-fcm-notifications plugin provides similar functionality, but it is no longer up to date with current Discourse. Installing it on a current Discourse installation produces warnings.

I had trouble getting the old plugin to work on other testers devices. Rather than trying to update it, I decided to build a new implementation from scratch.

Features

  • FCM push notifications for native mobile apps
  • Multiple devices per user
  • Device registration and removal through an API
  • Deep links to the relevant Discourse topic, post or chat
  • Automatic removal of invalid/expired FCM tokens
  • Retry handling for temporary Firebase failures
  • Optional privacy mode with generic notification content
  • Admin diagnostics and test-notification tools
  • Uses Discourse’s existing notification system and preferences

The plugin is intended to provide the delivery layer between Discourse and a native mobile app; Discourse remains responsible for deciding which notifications a user receives.

AI-assisted development

A significant part of this plugin was developed with the assistance of AI. I am posting it here partly to get feedback from experienced Discourse developers and to identify anything that should be changed or improved.

It is MIT licensed.

Feedback, bug reports and suggestions are welcome.

2 Likes

I am happy to share how I have implemented it in my Flutter wrapper app for my Discourse forum. I haven’t done Apple yet, only Android.

1 Like

You might want to request to be in @plugin_authors so that you can out this in Customization > Plugin .

2 Likes

@Michael_Sandler great work. I also work on a Flutter app for Discourse and have just launched it. I implemented Push Notification slightly different from what you did and it requires no plugin installation, although not instant.

I think I will go down to your path once there are many users using it.

Take a look and I appreciate feedback and maybe I can use your implementation too.

I’m now in @plugin_authors but I can’t modify the category

Hi, I’ve changed it to the correct category for you.

1 Like