Reputation: 2346
I'm new to facebook platform in general.
My goal is an Hello World bot for FB messenger (in test env), iv'e created:
When i got to the page --> Messenger Platform -> General Settings --> Subscribed Apps - i see nothing on the list.
How can i make my app subscribe? (preferable not programmatically, if possible).
Upvotes: 2
Views: 1659
Reputation: 634
I struggled with this all day. Hopefully this can help someone out.
Here are the steps I took to get the interaction from a test user -> test page -> chatbot to work:
Create a test user within your developers.facebook App Dashboard (Roles, Test Users)
Login with the test user and create a page (Test Users -> Edit -> Login with this test user)
Get a long-lived page access token that has the scopes:
pages_messaging
pages_show_list
pages_manage_metadata
pages_messaging_subscriptions (this is needed to register the webhook)
Use the page access token to programmatically register a webhook for the test page (don't think you can manually add from the dashboard):
POST to https://graph.facebook.com/v9.0/{testPageId}/subscribed_apps?subscribed_fields=messages,messaging_postbacks&access_token={longlivedPageAccessToken}
Unfortunately, even when I was able to subscribe the webhook + converse with my app through the test page, the app never showed my testpage in the webhooks section, so you'll have to repeatedly message the test page to see if webhooks are being sent.
note: using graphAPI 9.0 for all requests
Upvotes: 1
Reputation: 21
If I'm not wrong you can't subscribe your test page from the messenger settings page, it won't show like you said.
What you can do is subscribe by sending a post request to the graph api.
steps on how to subscribe test page
I followed the steps in there and my test page subscribed and works fine with my app
Upvotes: 1
Reputation: 266
In your facebook developer console go to setting and see webhook section and then
select a page to subscribe your webhook to the page events
Upvotes: 0