Messenger User Acquisition: How to build Facebook Comment Auto Reply(Private Reply) using nodeJS

9th October 2018 Off By binary
Messenger User Acquisition: How to build Facebook Comment Auto Reply(Private Reply) using nodeJS
trading bonus no deposit

Messenger User Acquisition: How to build Facebook Comment Auto Reply (Private Reply) using nodeJS

Note: This document refers to a feature that was removed after Graph API v2.10.

Part 1: Goto your Facebook app (https://developers.facebook.com/apps)

  • Request permission for following
    manage_pages,publish_pages,read_page_mailboxes,pages_messaging,pages_messaging_subscriptions
  • Enable “FEED” subscription (https://developers.facebook.com/apps/APP_ID/webhooks/)

Part 2: update your facebook messenger code as following:
(https://github.com/fbsamples/messenger-platform-samples)

Important note before copying the code: Don’t private reply to all the comments. Make sure you add some filters else be ready to receive a warning from FB (May suspend your app as well!!!)

app.post('/webhook', function (req, res) {
var data = req.body;
// Make sure this is a page subscription
if (data.object == 'page') {
// Iterate over each entry
data.entry.forEach(function(pageEntry) {
//Newsfeed changes webhook request
if(pageEntry.hasOwnProperty('changes')){
pageEntry.changes.forEach(function(changes){
if(changes.field=="feed" && changes.value.item=="comment" && changes.value.verb=="add"){
var messageData = {
message: "hello"
};


Messenger User Acquisition: How to build Facebook Comment Auto Reply(Private Reply) using nodeJS was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.

How to win at binary options?