Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't use test user to access Facebook page with Messenger Bot app

I am trying to setup my first Facebook bot by following this sample project in Glitch, connected to this quick start help page.

I have logged in with a real user, then created an app and added a messenger product as per the instructions. I have set the webhook, I have also created a page with this user, and subscribed the messenger bot to it using the app dashboard.

I can access the page with the real user and I can send messages to the page and the bot responds to those messages as expected. So far so good.

Now I would like to create test users, so that I can access this page and send messages with other users. I have followed the procedure indicated here to create such test users.

The problem is that those test users can't access the page: "Sorry, this content isn't available right now"

I have found this and this answers, which both point to this explanation.

Basically, the page the bot subscribes to must be created by one of the test users with manage_pages and pages_messaging permissions. Like this I can create other test users which can connect to the test page and send messages just fine. However, the bot is not properly subscribed to this new test page, despite following the provided steps. I followed all of them and got the success response in the subscription step:

https://graph.facebook.com/v2.9/me/subscribed_apps?method=POST&access_token=<TEST_USER_PAGE_ACCESS_TOKEN>

Still, the bot is not connected to the test page. I can send messages back and forth between test users on the test page, but the bot does not respond and I get no activity logs in the webhook.

In a nutshell:

  1. If I create a page with a real user, I can subscribe the bot successfully to the page, but I can't access the page with test users.
  2. If I create a page with a test user, I can access the page with other test users successfully, but I can't subscribe the bot to the page.

How can I solve this or at least troubleshoot it?

Facebook API v2.9

like image 755
atineoSE Avatar asked Apr 30 '17 17:04

atineoSE


People also ask

How do you test a Facebook bot?

One easy way to achieve automated testing for messenger bots atleast is to try to mimic a request coming from FB. You can just log the request you are getting to your bot to find the signature of the request that FB sends. Then you can just pretend to be FB by sending http requests with the same signature.

How do I get Messenger bot link?

'Bot link' is a link to a Messenger conversation with the Facebook Page connected to your ManyChat account. You can find your bot link in the 'Insights' tab of the 'Home' section under the Facebook Channel (it's blue).


1 Answers

The test user cannot access your real facebook page but you can message your bot (logged in as a test user) via the messenger short link (m.me/your_bot_link).

I used that in the testing steps (and video screencast) for the app permissions review submission.

like image 81
Leonard Lin Avatar answered Oct 23 '22 19:10

Leonard Lin