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