简体   繁体   中英

Send message to user in facebook customer chat plugin as soon as logged in

I'm trying to send a message to the user as soon as they click on the chat button on my Customer Chat Plugin, what I want to achieve is exactly the flow from this website: mobile monkey

The flow is:

  • User enters page and click log into messenger
  • chat window opens with message

I can't find any example on how to send the user this message without the user sending a message first . To send a message I need the PSID for the user in my php service, but I can't get any response on the user login.

Also, is there any way I can get that PSID on my frontend? What I'm developing requires the bot to ask questions when there is some user action on my website.

edit: Just to be clear, it is not the greeting message, it is and actual message when the chat window opens, see ref.

在此处输入图片说明

Ended up finding the answer, just had to use a postback webhook.

More info here : https://developers.facebook.com/docs/messenger-platform/reference/webhook-events/messaging_postbacks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM