MessengerExtensions : how to send a message by messenger to users?
Asked Answered
M

1

0

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.

Meridethmeridian answered 13/5, 2017 at 17:32 Comment(0)
C
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.

Cherise answered 16/5, 2017 at 4:42 Comment(2)
So I decided to test the login button approach and it work's well ! thank you !Meridethmeridian
Good to know. :)Cherise

© 2022 - 2024 — McMap. All rights reserved.