Facebook Messenger API - Permanent menu not working on mobile devices

I am making php curl call for an API endpoint to set up a persistent menu based on 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); 

ACCESS_TOKEN is set correctly, and the post post 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 will return a successful result:

 {"result":"Successfully added structured menu CTAs"} 

And the menu works on facebook on a computer on the Internet:
Permanent menu on the Internet
But it just does not appear in the Mobile Messenger app. I read elsewhere that it caches and takes time to freshen up, but I waited more than 24 hours. It has also been tested on both an Android phone and iPhone, but still does not display a menu.

+5
source share
1 answer

You need to restart the Facebook Messenger app on your mobile device because the moblie app caches the menu at startup.

+2
source

Source: https://habr.com/ru/post/1257554/


All Articles