Messenger 平台中的位置小部件在移动版中显示搜索栏,但在桌面版中不显示
Location widget in messenger platform displays a search bar in mobile version but not in Desktop Version
通过使用facebook messenger平台提供的bot功能,
我希望用户能够使用搜索提供位置。
它在 Messenger 的移动应用程序中按预期工作,因为它显示了搜索选项。但在桌面版的 Messenger 中,search option is not showing in location widget.
我想问一下这是预期的行为还是我遗漏了什么。
同样在浏览器控制台中,它显示了一些错误:
ErrorUtils caught an error:
"navigator.permissions.query(...).then(...).done is not a function".
Subsequent errors won't be logged;
see https://fburl.com/debugjs.ja @ qtaMy7UNoCv.js:47
.
这是我到目前为止尝试过的方法:
def send_location_with_quick_reply(self, recipient_id, message, quick_replies):
url = self.get_message_url()
payload = {
"recipient":{
"id":recipient_id
},
"message":{
"text": message,
"quick_replies":[{
"content_type": "location"
}]
}
}
# _do_post will hit the send_message API of `Messenger`.
return self._do_post(url, payload)
这是我在用户选择位置后得到的响应:
{
"object": "page",
"entry": [{
"id": "128922990987384",
"time": 1505890084176,
"messaging": [{
"sender": {
"id": "1456347437763847"
},
"recipient": {
"id": "128922990987384"
},
"timestamp": 1505890084065,
"message": {
"mid": "mid.$cAAAvskrTvY9kz1Bs4Vengsjpb9L_",
"seq": 2366,
"attachments": [{
"title": "User's Location",
"url": "https:\/\/l.facebook.com\/l.php?u=https\u00253A\u00252F\u00252Fwww.bing.com\u00252Fmaps\u00252Fdefault.aspx\u00253Fv\u00253D2\u002526pc\u00253DFACEBK\u002526mid\u00253D8100\u002526where1\u00253D12.9703749\u0025252C\u00252B77.6361206\u002526FORM\u00253DFBKPL1\u002526mkt\u00253Den-US&h=ATNsjbke0tPFGIFpCq4MA5l1W6wmiwp0cTfUZNXSSbMDHxygEM4GrVlZmtaebsN4elliFhMSJNmIFwQgn-p_fxnF2hW0VdKTj2z_0hsWnH4dlLZGdQ&s=1&enc=AZN9DwrutbtXSfRAdxQf4bzFSMSO3zujAb0LBOgUt9mz16ZnDn7CSZDBLmnISjfAMbLG6b6H6hn9a3KCb6wOo7dn",
"type": "location",
"payload": {
"coordinates": {
"lat": 12.9703749,
"long": 77.6361206
}
}
}]
}
}]
}]
}
我正在使用 python 和 drf 与 Messenger 平台集成。
是的,这是当前的预期行为。
通过使用facebook messenger平台提供的bot功能, 我希望用户能够使用搜索提供位置。
它在 Messenger 的移动应用程序中按预期工作,因为它显示了搜索选项。但在桌面版的 Messenger 中,search option is not showing in location widget.
我想问一下这是预期的行为还是我遗漏了什么。
同样在浏览器控制台中,它显示了一些错误:
ErrorUtils caught an error: "navigator.permissions.query(...).then(...).done is not a function". Subsequent errors won't be logged; see https://fburl.com/debugjs.ja @ qtaMy7UNoCv.js:47
.
这是我到目前为止尝试过的方法:
def send_location_with_quick_reply(self, recipient_id, message, quick_replies):
url = self.get_message_url()
payload = {
"recipient":{
"id":recipient_id
},
"message":{
"text": message,
"quick_replies":[{
"content_type": "location"
}]
}
}
# _do_post will hit the send_message API of `Messenger`.
return self._do_post(url, payload)
这是我在用户选择位置后得到的响应:
{
"object": "page",
"entry": [{
"id": "128922990987384",
"time": 1505890084176,
"messaging": [{
"sender": {
"id": "1456347437763847"
},
"recipient": {
"id": "128922990987384"
},
"timestamp": 1505890084065,
"message": {
"mid": "mid.$cAAAvskrTvY9kz1Bs4Vengsjpb9L_",
"seq": 2366,
"attachments": [{
"title": "User's Location",
"url": "https:\/\/l.facebook.com\/l.php?u=https\u00253A\u00252F\u00252Fwww.bing.com\u00252Fmaps\u00252Fdefault.aspx\u00253Fv\u00253D2\u002526pc\u00253DFACEBK\u002526mid\u00253D8100\u002526where1\u00253D12.9703749\u0025252C\u00252B77.6361206\u002526FORM\u00253DFBKPL1\u002526mkt\u00253Den-US&h=ATNsjbke0tPFGIFpCq4MA5l1W6wmiwp0cTfUZNXSSbMDHxygEM4GrVlZmtaebsN4elliFhMSJNmIFwQgn-p_fxnF2hW0VdKTj2z_0hsWnH4dlLZGdQ&s=1&enc=AZN9DwrutbtXSfRAdxQf4bzFSMSO3zujAb0LBOgUt9mz16ZnDn7CSZDBLmnISjfAMbLG6b6H6hn9a3KCb6wOo7dn",
"type": "location",
"payload": {
"coordinates": {
"lat": 12.9703749,
"long": 77.6361206
}
}
}]
}
}]
}]
}
我正在使用 python 和 drf 与 Messenger 平台集成。
是的,这是当前的预期行为。