Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do Facebook Messenger Bot development locally?

When setting webhooks, it's saying a Secure URL is required.

like image 969
Volatil3 Avatar asked Apr 17 '16 08:04

Volatil3


People also ask

How to debug a Facebook Messenger bot application?

With Facebook messenger bot fortunately, there’s a way to be able to debug and run your bot application running locally through ngrok or localtunnel. Ngrok is more generic while localtunnel is more tailored for node environment. Let’s have a look at the setup for ngrok and localtunnel to enable us debugging our chat bot application locally.

What are bots for messenger and who are they for?

You can read more about the announcement in today's Facebook Newsroom post. Bots for Messenger are for anyone who's trying to reach people on mobile - no matter how big or small your company or idea is, or what problem you're trying to solve.

How to access local chat client from Messenger bot?

When you hook up the library, you can access the local client at an url you defined (e.g. http://localhost:5000/webhook/localChat/ ): I did not try programming with the Messenger Bot yet, but i know how webhooks work, so here´s the problem:

What's new in messenger for messenger?

To compliment the functionality of bots for Messenger, we're introducing another tool to facilitate more complex conversational experiences, leveraging our learnings with M. The wit.ai Bot Engine enables ongoing training of bots using sample conversations. This enables you to create conversational bots that can automatically chat with users.


4 Answers

I am using ngrok to tunnel a localhost address. There is an example here: https://github.com/wit-ai/node-wit

like image 194
Wataru Kay Avatar answered Oct 22 '22 11:10

Wataru Kay


I created a library that tries to solve this exact problem! With fb-local-chat-bot you can easily test your bot offline. One nice thing is that you can get started on development WITHOUT even connecting with Facebook.

The library also makes testing much more simple. If you're interested, definitely check it out

https://github.com/spchuang/fb-local-chat-bot

This is how it looks. When you hook up the library, you can access the local client at an url you defined (e.g. http://localhost:5000/webhook/localChat/):

like image 30
spchuang Avatar answered Oct 22 '22 11:10

spchuang


I did not try programming with the Messenger Bot yet, but i know how webhooks work, so here´s the problem:

Webhooks are basically URLs that are called from Facebook. I assume you are trying to set up webhooks with localhost, but how would Facebook access localhost? It only exists on your own computer. Also, the error message is very clear, you need SSL for the webhook URL. There are "self signed certificates" for localhost, but it does not help you in that case - again, Facebook needs to be able to call that webhook callback URL.

like image 20
andyrandy Avatar answered Oct 22 '22 10:10

andyrandy


I have started messenger development 2 days ago.I was able to access localhost from any where over internet by using ngrok http://ngrok.com give it a try .

like image 20
hussein shaib Avatar answered Oct 22 '22 09:10

hussein shaib