How to do Facebook Messenger Bot development locally?
Asked Answered
L

6

11

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

Lindbom answered 17/4, 2016 at 8:2 Comment(2)
What's the reason of downvoting me?Lindbom
probably because your question is just a one-liner (= too broad) and the error message is very clear...either way, check out my answer.Tawnatawney
T
11

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

Tapdance answered 17/4, 2016 at 15:28 Comment(0)
E
4

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/):

Expressivity answered 19/8, 2016 at 8:26 Comment(1)
Now this library can handle authentication requests from Messegner, too :)Knossos
T
1

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.

Tawnatawney answered 17/4, 2016 at 8:13 Comment(0)
R
1

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 .

Risa answered 21/4, 2016 at 5:31 Comment(1)
Thanks for your reply, I would for sure. Also, is there anyway to connect with you off site as I might have questions regarding fb bot development?Lindbom
S
0

You can't receive messages from facebook, because they are calling your webhook URL (SSL ofcourse). You can found more in documentation.

However you can send messages to user from localhost - apparently they are fine with it.

Squabble answered 17/4, 2016 at 12:33 Comment(0)
F
0

I tried using ngrok as described in the link below and got it to work with messenger. https://sumwu.me/blog/page/9/how-to-create-a-facebook-messenger-bot/

Faceharden answered 1/5, 2016 at 1:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.