- python3.6
- ngrok
- in your python virtualenv
$ python install -r requirements.txt
- in your python interactive interpretor
import secrets
secrets.token_hex(nbytes=16)
- crate a json file name
.config.json
, and follow up the format below (you should fill up the value)
{
"VERIFY_TOKEN": "",
"PAGE_TOKEN": ""
}
- run this application, default setting is binding the port
8000
$ python app.py --debug
- use ngrok to get SSL, here set to bind the port
8000
$ ./ngrok http 8000
- enter the verify token and SSL URL
- note that
回呼網址
should enter the webhook routerhttps://ngrok.***.io/webhook
- note that
- can check facebook doc
- select your facebook page and generate page token
MIT @ Kuoteng, 2018