Remember your heroku ID and app address. ex: https://APP_ADDRESS.herokuapp.com/
Make sure you already have Facebook account, if you need use FB Bot.
Create App, need select as follow:
- New App type [Web App], create app
- Add new product [Messenger]
Get token from Faccebook page.
- Select a "Page" you own.
- Go to "Meseenger" product.
- It will generate
token
- copy it and store it.
Go to heroku dashboard, go to "Setting" -> "Config Variables".
- Add "Config Vars"
- Name -> "TOKEN"
- Value use
token
facebook app.
- Go to "Messenger" product
- Go to "Setup Webhooks"
- Fill
https://APP_ADDRESS.herokuapp.com/webhook
in callback URL. - Fill your
token
in "token". - Checked the checkbox "message_deliveres", "messages".
If your configuration is correct, it will show "completed".
Also remember to choose correct page in this setting.
In Messenger application review, press "Request Premission".
- Checked the "pages_messaging".
- Go to your spcific "page" in Facebook.
- Press "Send Message"
- Fork code here
- Add remote repo
https://git.heroku.com/APP_ADDRESS.git
- Modify code on
main.go
first. especially inMessageReceived()
. - Commit and push it back to heroku
git push heroku master
.
- Provides a GO SDK for Facebook's messenger-platform
- FB: Messenger Platform/Getting Started
- [教學] Facebook Messenger API
- 用Python開發Facebook Bot
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.