问题
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