MessengerExtensions : how to send a message by messenger to users?

▼魔方 西西 提交于 2019-12-25 12:48:15

问题


I use webviews with my messenger chatbot.

On my webapp's view, I used MessengerExtensions.requestCloseBrowser() to close the webview on iOS and Android.

It works perfectly but, i have no idea how i could give feedback to my user by send a message when the webview is closed

Could you help me please ?

Thx.


回答1:


You can do a server round trip.

closing webview has a success callback. You can make an api call to one of your webservice. You pass the page scoped user id to this service. Then once you know who the user is, you can send the message to the user using the Send API

Another approach. In case you are asking the user to login in webview, you can use the login button. In this case once the user is redirected to the messenger (i.e. after webview is closed) you will get a webhook event and using that you can send the message to the user.



来源:https://stackoverflow.com/questions/43956045/messengerextensions-how-to-send-a-message-by-messenger-to-users

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!