php - Webhook messenger FB APIGet the solution ↓↓↓
I am trying to activate the receipt of facebook messages on my webhook, but according to the facebook documentation there is no longer an option .. for example, in the print below I am looking for the "messages" permission but it does not exist anymore ...
Currently I installed the messenger component in my application, however I realized that if I go manually and activate the receipt of the pages it works, however as I said "manual", I would like to automate this via the option of "subscriptions".
I added in my code the sending of the "messages" field, however it also has no effect ...
$facebook = new Facebook(); $facebook->setDefaultAccessToken($page['access_token']); //?subscribed_fields=leadgen $response = $facebook->post( '/' . $page['id'] . '/subscribed_apps', [ 'subscribed_fields' => [ 'leadgen', 'feed', 'messages', ], ], $page['access_token'] );
If you want to do this in the UI you have to do it in the Messenger products settings, not Webhook settings(your first screenshot).
This guide explains how to do it: https://developers.facebook.com/docs/messenger-platform/getting-started/app-setup#setting-up-your-facebook-app
People are also looking for solutions of the problem: videoxxx
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.