lemieux/react-messenger-plugin

Onclick callback

Opened this issue · 2 comments

Is it possible to implement a callback when the button is pressed?
Useful when automatically closing dialogs that prompt people to connect to messenger

When I wrote this wrapper, FB didn't have any useful event, but it seems they added rendered, clicked, and not_you.

I don't have much time to implement that currently, but as a workaround you could listen yourself to the event on the FB SDK. Once loaded, you should be able to access it via window.FB and handle it yourself. Here's FB docs about it : https://developers.facebook.com/docs/messenger-platform/plugin-reference/send-to-messenger#event

Thanks @lemieux - I might have a go at implementing this later this week