I am making a php curl call to the API endpoint to set up a persistent menu based on the documentation. Here is the code:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/v2.6/me/thread_settings?access_token='.FB_ACCESS_TOKEN);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postbody);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$output = curl_exec($ch);
curl_close($ch);
error_log($output);
The ACCESS_TOKEN is set correctly and the $postbody looks like this:
{"setting_type":"call_to_actions","thread_state":"existing_thread","call_to_actions":[{"type":"postback","title":"My Album","payload":"{\"type\":\"button1\",\"data\":{\"category\":\"album\"}}"},{"type":"postback","title":"Help","payload":"{\"type\":\"button1\",\"data\":{\"category\":\"help\"}}"}]}
I get back a successful result:
{"result":"Successfully added structured menu CTAs"}
And the menu works on facebook on the computer on web:
But it simply does not appear on the mobile Messenger app. I've read elsewhere about it being cached and taking time to refresh, but I've waited over 24 hours now. Also, tested on both an Android phone and an iPhone and still don't see the menu.
Setting the Persistent Menu To set the persistent menu, send a POST request to the Messenger Profile API to set the persistent_menu property of your bot's Messenger profile. As a replacement for the deprecated nested level menu, we allow up to 20 buttons in the call_to_actions array for Graph API v8. 0+.
Click + New Menu Item to add a new item to the menu. You need to add a custom name for the menu item and enter the link. For example, you can add the promotion page as one of the menu items to let your customers know more about the existing promotion. Click Save after adding the contents of the menu item.
The Messenger Profile API allows you to set, update, retrieve, and delete properties from the Page Messenger Profile.
Messenger from Meta is a messaging service that allows a business' Facebook Page or Instagram Professional account to respond to people who are interested in your business or social media. Conversations between a person and your account must be initiated by the person. The Messenger Platform is free for you to use.
You have to restart the Facebook Messenger application on your mobile, because the moblie application caches the menu on start.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With