Search code examples
botsfacebook-messenger-botfacebook-chatbot

How to debug a facebook messenger bot that is already production without having to use a separate dummy test page?


I will name my first born after whoever answers this question!

How does one test / debug upcoming features for a facebook bot that is already production without having to use a separate dummy test page? (I need to keep it in the same page because user ids are page scoped).

In the facebook dev dashboard I created a test app, subscribed it to the same facebook page, changed its webhook to ngrok and added it some tester roles but the test bot is still receiving all webhooks from the production app instead of only from testers. I would like to have separated production / test bots but within the same fb page.

Please help!


Solution

  • You can detect the test user PSID, then use the handover protocol to pass thread control to the test app.

    https://developers.facebook.com/docs/messenger-platform/handover-protocol/