Purpose of this integration is to receive a message on Slack for new Notifications and Messages received on Facebook.
Installing Facebook-Slack-Integration for your slack
Obtaining Slack Incoming Webhook url:
- Go to
@slackbotas channel and add Incoming Webhook Integration.
- Copy the Webhook URL and enter it as
slack_urlin config variables at deployment stage.
- Customize the webhook with your favorite name and icon (Facebook Favicon included) and save.
- Go to
Obtaining Facebook App ID and App Secret:
- Go to Facebook Developers and register.
- Follow instructions and create a new web app.
- On you app's page, Copy the App ID and enter it as
app_idin config variables at deployment stage.
- Copy the App Secret and enter it as
app_secretin config variables at deployment stage.
Obtaining Facebook User Access Token:
- Go to Facebook Graph Explorer Tool.
- Select your fb app in application dropdown and click 'get token' > 'get access token'.
user_about_mepermission and from extended permissions select
get access tokenand enter the token generated as
access_tokenin config variables at deployment stage.
Fork and clone this repository to you local.
Add heroku remote to your local repo using the deploy instructions in the deploy tab of your heroku app.
Push to remote using command:
git push heroku master
heroku psto confirm that you web is working otherwise run command to start your app:
heroku ps:scale web=1
Keeping Active (for heroku deploys):
- Heroku tends to kill the dyno if the app route is inactive for 30mins (may change). Hence, we will use one of the ping services available online. I chose HerokuPing.
- Just submit your heroku app url there and it will ping your app every 10mins, firing up the facebook checking functions.
Using Facebook-Slack-Integration with slack
After above steps, Facebook-Slack-Integration will check new fb messages every time the app is pinged by the service you chose while checking new fb notifications every 6th time to keep you updated at your chosen slack channel for the webhook.
You will need to re-generate your facebook access token (step 3) every 2 months. This is a restriction made by fb api for security reasons.
Support or Contact
Having trouble with Facebook-Slack-Integration? Create an issue in the repository GitHub Repo.