I am trying to use the ActionTypes.OpenUrl
type on a CardAction
in a hero card on kik. all it does is echo back the message. It does not actually open a URL. I have the same code working on multiple channels, but cannot get it working on kik. Has anyone been able to find a work around for this?
Here is the code I am using:
Activity reply = activity.CreateReply();
var card = new HeroCard
{
Title = "title",
Text = "text",
Buttons = new List<CardAction> {new CardAction(ActionTypes.OpenUrl,"url 1", text: "open url 1", value:@"https://www.google.com/"),
new CardAction(ActionTypes.OpenUrl,title:"url 2", text: "open url 2", value:@"https://www.google.com/"),
new CardAction(ActionTypes.OpenUrl,title:"url 3", text: "open url 3", value:@"https://www.google.com/")
}
};
reply.Attachments.Add(card.ToAttachment());
await context.PostAsync(reply);
This is unfortunately not going to work for you. In order to display "Hero Cards" in kik Bot Framework has to use keyboards specifically, the Suggested Response Keyboard which does not support an open url type. According to their documentation: "The type of response to send. Must be one of: text
, friend-picker
, picture
". So there is no way to actually open a URL from a button in a herocard on kik.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With