Notifications via Facebook

Well, actually I have some possibly good news :wink: As I’m kind of obsessed with the idea of delivering notifications to my community users via their Facebook (through Messenger and/or notifications), I’m in the middle of deconstructing those nightmarish API procedures.
Unfortunately, I’m not a Ruby developer, so I won’t be able to create any plugin myself. I can only provide ‘bare’ algorythm or pseudocode, but to reforge it into a functional Discourse plugin (or plugins perhaps?) I would need help of a qualified programmer.

Why do I believe we need this as a community?

  1. We have use cases (I believe) of moving communities from fb groups into :discourse: , and enabling a mechanism to recieve :discourse: notifications on a channel that they are used to would smoothen this transitions a lot.
  2. Facebook is a threat to other online communities as it tends to ‘suck out’ any online activity. People are active on FB virtually 24/7 and because of that the’re not very eager to move to any external services when they feel that all their needs - in this case communication needs - are already well served there. Providing them with :discourse: notifications in spaces where they are already present, could be a way to fight that tendency, since the user would receive ‘pings’ from their :discourse: based community in exactly the same way as the rest of their daily communication.

Regarding issues mentioned above

It is doable. I’m positive for this very moment, after digging into Messenger API that we can move to sending notifications with little bit of algorithms and some smart code.

Well, this is actually a real problem. You could say that :discourse: notifier app can be counted into any of the allowed category, and I highly doubt that it would contain

advertising, marketing, solicitations, or promotional conten

in most use cases. But we have to be realistic: ToS of this API are made exactly to stop any other social and discussion channels from using the platform. There are though some possible solutions: from hoping that they wouldn’t notice, to using third-party libraries or even providing own solution based on available MQTT gem. Other interesting solution would be displaying Discourse forum as FB Canvas app perhaps? Still, what matters is that: there are options.

Well, yeah. You know, group conversations on FB were not designed for bots, but for people :wink: But I’ve already seen services which had standalone browser version and FB Canvas embedded (and using notifications) version as well, maybe this would be some solution? But I admit, I didn’t dig into this, as group notifications are somewhat out of my scope. But there are options worth considering.


Sadly I suspect you’re right about this.

Aside from the discourse-chat-integration plugin, I really like the idea of sending ‘actual’ facebook notifications from Discourse, something that was touched on here:

I wonder whether @joebuhlig or @brunoedigital got anywhere with the idea?

It’s something I might be interested in developing for my community (and open sourcing, of course), but that won’t be for a while.


Yeah, but you have to remember about one of the most important Open Source rules - when they close the door, we enter via window :wink: Anything that is not explicitly forbidden in ToS is allowed, right?I doubt that they’ll change their APIs and methods again just because some discussion software community found some loophole :stuck_out_tongue:

I’d like to ask you about Telegram Notifications Plugin (discourse-telegram-notifications) : it interacts with Telegram bot when regular :discourse: notification is created, is that right?

About the notifications - yes, they are available for every app, and if we’d combine it with embedding :discourse: instance as a FB canvas app, we would escape the TOS, as redirecting users out of faceook by app is explixitly forbidden. And I still remember, that making canvas app out of regular website is rather straight-forward, I did something like this with Drupal once.

Perhaps we could use the “invite friend to this app” mechanism as well? Combined somehow (or not) with :discourse: built-in invitations system?

1 Like

Yep, that’s exactly right. The Discourse plugin API makes that bit super easy. So we’d have something like

DiscourseEvent.on(:post_notification_alert) do |user, payload|
   # Send a notification to facebook using user information
   # and the notification data in the payload

It’s worth a try, but discourse is a very complicated app that probably won’t like being stuck inside an iFrame… We might be able to leverage the discourse API to build a separate (read only) UI inside facebook, but that does increase the work a lot. Ideally we’d just link to Discourse, but if that’s a breach of their ToS then they may well shut it down.

One very large issue I’ve just noticed is in the API Description for “App Notifications”

The notifications are only surfaced on the desktop web version of Facebook

That limits the usefulness a lot, given the huge proportion of people that access facebook on a mobile device :frowning: .

Not really. There is separate API for mobile push notifications, more sophisticated :slight_smile:

1 Like

Are you talking about this product? Looks like it requires you to have your own app in the Android/iOS app stores - it doesn’t send the notifications via the facebook app.

If that’s not it, can you post a link - I can’t anything else in their API docs :slight_smile:

1 Like

Damn, you’re right! :disappointed_relieved:
But wait, is there even a possibility to play games on mobile Facebook? It seems no, so that would explain why push notif. by apps are not supported…

So, I have found in documentation that:

Game requests are available for Games on Facebook and for mobile games on iOS and Android. On the Facebook desktop site, requests appear as a beeper pop-up in the lower left of the screen as well as in the notifications jewel. On mobile platforms requests will surface within the list of notifications in the Facebook App.

So, it’s not like this notifications are not displayed on mobile device!

Hey there. Yeah I was really interested in this as well and I even started working on it with @joebuhlig

Unfortunately from what we’ve found, Facebook frowns upon having notifications with links opening up an external website.

I believe you could still do just notifications, with no link or anything to click… but then I’m not sure how useful/good that would be.

Let’s see if @joebuhlig can share some more light in this matter as he was the one to get in touch with people from Facebook.

But if we find a way I’m totally down :slight_smile:

1 Like

Hi there! Thanks a lot for the feedback.
So, according to FB’s terms of service, creating a notification that redirects user out of Facebook is explicitly and strictly forbidden.
That’s why I came up with the idea of embedding whole :discourse: forum into Facebook as an app.
At this moment it seems to be entirely possible, but I won’t be sure untill the app is finished and passes the review.
Of course I’ll be happy for any additional feedback you can provide.

1 Like

Can we use FB Instant articles when sending notifications? So forum can load in fb without opening an external website.

No, Instant Articles don’t send any kind of notifications.


Oh, sorry, did you mean showing IA after user hits notification? If so, I have to admit I have no clue. Perhaps it would be possible, but as notifications provided in fb Games work mostly od desktops, and Instant Articles show up on mobile devices, I don’t see a point in it…

1 Like

I tried to work this from a number of angles but ultimately ended up contacting Facebook (not a simple task). The issue starts here:

Policy terms Section 4 Item 8:

  1. Don’t build an app whose primary purpose is to redirect people off of Facebook.

And here’s a link to a video they sent me to go through. In order to use the notifications system, you need to be using a canvas app.

I looked into the concept of posting an iframe of Discourse into the canvas and running it that way but that has some issues with functionality on the Discourse side as well as being frowned upon by FB.

What they eventually told me:

We highly discourage pulling an existing site into an app on Facebook. It’s easy for links within the iframe application to lead off of Facebook and will then put you in violation of policy.

They seem dedicated to keeping folks on FB and leading developers to building apps specifically for FB as opposed to repurposing code. I know there are services and sites out there that do this exact process but the two or three that I talked to said they had been put on a “watch list” by FB and are likely to be shut down soon.


Sad, but not unexpected. Thanks to everyone for digging into this. :clap:

In the coming weeks @HAWK and I will be working on more content for “best practice community management with Discourse”. We’ll be sure to include a tutorial on Facebook content sharing strategies.