0

I have a node.js code which I run on cloud9 for development and I want to subscribe my "test" Facebook page messenger to that link in order to use it for testing\sandboxing.

But when I try to subscribe the webhook to the Cloud9 link my app is running on, I get this:

enter image description here

The link I use is: https://node-.c9users.io Port is 8080

If I navigate to that link directly from the browser while app is running - i do get a response. Why FB Subscription can't get through?

GeekSince1982
  • 732
  • 10
  • 25

2 Answers2

0

By default you need to be logged in on C9 to see the published URL, so when Facebook try to register it receive the "login to C9 page" instead of your app URL.

To fix this you need to share the workspace where your webhook is running and make it public.

Go to "Window->Share" and click on checkbox "public" for your application.

Sharing your workspace Sharing your App URL

0

Besides the answer of @Roberdam i would recommande you to set the GET route as folowing :

app.get('/', function (req, res) {
console.log(req);
if (req.query['hub.verify_token'] === 'verifycode') {
res.send(req.query['hub.challenge']);
}
res.send('Error, wrong validation token!');
});

where the hub.challenge is the a random generated value that your webhook returns.

ihoudjedje
  • 95
  • 9