I want to use Facebook Messenger Extensions (opening a Webview) with Microsoft Edge.
My app sends a request to the REST API endpoint messages. The payload is as follows. Documentation on this.
{
"messaging_type":"RESPONSE",
"recipient":{
"id":"<id>"
},
"message":{
"attachment":{
"type":"template",
"payload":{
"template_type":"button",
"text":"Test text",
"buttons":[
{
"type":"web_url",
"url":"https://c0292fc0.ngrok.io/facebook/render_multi_choice?data=24561",
"title":"Test Button",
"webview_height_ratio":"full",
"messenger_extensions":"true",
"fallback_url":"https://c0292fc0.ngrok.io/facebook/render_multi_choice?data=24561"
}
]
}
}
}
}
When the user taps the button "Test Button" in Messenger, a Webview pops up and displays the response at the fallback URL / URL : https://c0292fc0.ngrok.io/facebook/render_multi_choice?data=24561
Note the URL contains one parameter, data = 24561
My Python Flask App receives the request:
@application.route("/facebook/render_multi_choice", methods=["GET"])
def render_multi_choice():
args = request.args
print(args)
return "OK"
The issue is that one would expect args to be printed out as:
ImmutableMultiDict([('data', 24561), ('fb_iframe_origin', '')])
Yet, it is printed out as:
ImmutableMultiDict([('data', ''), ('fb_iframe_origin', '')])
My flow works fine in Google Chrome, but NOT on Microsoft Edge. Do you have any idea what the issue could be? If I open the URL directly in the browser (without the Webview), things work as expected on Edge.
Aucun commentaire:
Enregistrer un commentaire