Bot Framework openUrl not working for suggested action on messenger

爷,独闯天下 提交于 2019-12-10 14:54:32

问题


I am creating facebook bot using Bot Builder Node.js sdk and I am trying to create suggested action, which would navigate users to web page. I know, that facebook has limitation, that it redirects only to https endpoints, but as the the page I am redirecting to is https, this is clearly not a problem. Here is my code:

var msg = new builder.Message(session)
.text("User message here")
.suggestedActions(
    builder.SuggestedActions.create(
            session, [
                builder.CardAction.imBack(session, "command1", "Command1"),
                builder.CardAction.imBack(session, "command2", "Command2"),
                builder.CardAction.openUrl(session, "https url", "Go to web")
            ]
        )); 
session.send(msg);

Problem is, that when I click the openUrl action on messenger, nothing happens. It works properly on emulator. Please, can somebody help me, how to solve this issue? Thank you.


回答1:


Facebook messenger suggested actions (Quick Reply) do not support "openURL". Quick Replies only support the following:

  • Text Quick Reply: Text will be shown to user, payload will be send back to bot
  • Phone Number Quick Reply:

allows you to ask a user for the phone number. When the phone number quick reply is sent, the Messenger Platform will automatically pre-fill the displayed quick reply with the phone number from the user's profile information.

  • Email Quick Reply:

allows you to ask a user for the email. When the email quick reply is sent, the Messenger Platform will automatically pre-fill the displayed quick reply with the email from the user's profile information.

  • Location Quick Reply (Deprecated)


来源:https://stackoverflow.com/questions/45081848/bot-framework-openurl-not-working-for-suggested-action-on-messenger

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