Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent menu: it does not work correctly @page.callback #23

Open
geordanSoapros opened this issue Jun 16, 2017 · 2 comments
Open

Persistent menu: it does not work correctly @page.callback #23

geordanSoapros opened this issue Jun 16, 2017 · 2 comments

Comments

@geordanSoapros
Copy link

When I press an option in the persistent menu, it does not give an operation signal.

def show_persistent_menu():
    page.show_persistent_menu([Template.ButtonPostBack('Cotizaciones', 'MENU_PAYLOAD/1'),
                               Template.ButtonPostBack('Postulacion', 'MENU_PAYLOAD/2'),
                               Template.ButtonPostBack('Contacto', 'MENU_PAYLOAD/3')])

@page.callback(['MENU_PAYLOAD/(.+)'])
def click_persistent_menu(payload, event):
    click_menu = payload.split('/')[1]
    print("you clicked %s menu" % click_menu)

`Any ideas?

@piedpipes
Copy link

Is this perhaps because FB is now using the messenger_profile API for its Persistent Menu?

    def _send_thread_settings(self, data):
        r = requests.post("https://graph.facebook.com/v2.6/me/thread_settings",
                          params={"access_token": self.page_access_token},
                          data=data,
                          headers={'Content-type': 'application/json'})

        if r.status_code != requests.codes.ok:
            print(r.text)

from https://github.com/conbus/fbmq/blob/master/fbmq/fbmq.py#L304-L311
is using the thread_settings API.

I haven't tried fixing this myself yet.. it's on my todo list... :)

@anton-nayshtut
Copy link
Contributor

Works for me. @geordanSoapros please check your Callback URL configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants