New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive card not working on Emulator #244

Closed
jazzedge opened this Issue Jul 12, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@jazzedge

jazzedge commented Jul 12, 2017

Hi, despite guidance to the contrary, it looks like the adaptive card isn't working on the latest version of the Emulator. I get the following error: [File of type 'application/vnd.microsoft.card.adaptive'] when trying to display the card from this repo: https://github.com/Microsoft/BotBuilder-Samples/blob/master/Node/cards-AdaptiveCards/app.js#L138-L153. Any suggestions?

The code is as follows:

var bot = new builder.UniversalBot(connector, function (session) {
var card = {
'contentType': 'application/vnd.microsoft.card.adaptive',
'content': {
'$schema': 'http://adaptivecards.io/schemas/adaptive-card.json',
'type': 'AdaptiveCard',
'version': '1.0',
'body': [
{
'type': 'Container',
'speak': 'Hello!Are you looking for a flight or a hotel?',
'items': [
{
'type': 'ColumnSet',
'columns': [
{
'type': 'Column',
'size': 'auto',
'items': [
{
'type': 'Image',
'url': 'https://placeholdit.imgix.net/~text?txtsize=65&txt=Adaptive+Cards&w=300&h=300',
'size': 'medium',
'style': 'person'
}
]
},
{
'type': 'Column',
'size': 'stretch',
'items': [
{
'type': 'TextBlock',
'text': 'Hello!',
'weight': 'bolder',
'isSubtle': true
},
{
'type': 'TextBlock',
'text': 'Are you looking for a flight or a hotel?',
'wrap': true
}
]
}
]
}
]
}
],
'actions': [
// Hotels Search form
{
'type': 'Action.ShowCard',
'title': 'Hotels',
'speak': 'Hotels',
'card': {
'type': 'AdaptiveCard',
'body': [
{
'type': 'TextBlock',
'text': 'Welcome to the Hotels finder!',
'speak': 'Welcome to the Hotels finder!',
'weight': 'bolder',
'size': 'large'
},
{
'type': 'TextBlock',
'text': 'Please enter your destination:'
},
{
'type': 'Input.Text',
'id': 'destination',
'speak': 'Please enter your destination',
'placeholder': 'Miami, Florida',
'style': 'text'
},
{
'type': 'TextBlock',
'text': 'When do you want to check in?'
},
{
'type': 'Input.Date',
'id': 'checkin',
'speak': 'When do you want to check in?'
},
{
'type': 'TextBlock',
'text': 'How many nights do you want to stay?'
},
{
'type': 'Input.Number',
'id': 'nights',
'min': 1,
'max': 60,
'speak': 'How many nights do you want to stay?'
}
],
'actions': [
{
'type': 'Action.Submit',
'title': 'Search',
'speak': 'Search',
'data': {
'type': 'hotelSearch'
}
}
]
}
},
{
'type': 'Action.ShowCard',
'title': 'Flights',
'speak': 'Flights',
'card': {
'type': 'AdaptiveCard',
'body': [
{
'type': 'TextBlock',
'text': 'Flights is not implemented =(',
'speak': 'Flights is not implemented',
'weight': 'bolder'
}
]
}
}
]
}
};

var msg = new builder.Message(session)
.addAttachment(card);
session.send(msg);
});

@Jeffders

This comment has been minimized.

Show comment
Hide comment
@Jeffders

Jeffders Jul 12, 2017

Member

Hi jazzedge,

I tried your repo code and was able to get the card to render with the emulator version v3.5.29:

image

Can you double check the version you are running...when the emulator is open, click on the vertical three dots to bring up the context menu and choose "About".

Jeff

Member

Jeffders commented Jul 12, 2017

Hi jazzedge,

I tried your repo code and was able to get the card to render with the emulator version v3.5.29:

image

Can you double check the version you are running...when the emulator is open, click on the vertical three dots to bring up the context menu and choose "About".

Jeff

@jazzedge

This comment has been minimized.

Show comment
Hide comment
@jazzedge

jazzedge Jul 12, 2017

I'm on 3.5.29

jazzedge commented Jul 12, 2017

I'm on 3.5.29

@jazzedge

This comment has been minimized.

Show comment
Hide comment
@jazzedge

jazzedge Jul 12, 2017

Interestingly, it works on my Mac, not on my Windows laptop. I'll try deleting and installing the Emulator and trying again.

jazzedge commented Jul 12, 2017

Interestingly, it works on my Mac, not on my Windows laptop. I'll try deleting and installing the Emulator and trying again.

@Jeffders

This comment has been minimized.

Show comment
Hide comment
@Jeffders

Jeffders Jul 13, 2017

Member

Did this work once you reinstalled things on Windows?

Member

Jeffders commented Jul 13, 2017

Did this work once you reinstalled things on Windows?

@jazzedge

This comment has been minimized.

Show comment
Hide comment
@jazzedge

jazzedge Jul 14, 2017

Move from 3.5.27 to 3.5.29, now working, thanks!

jazzedge commented Jul 14, 2017

Move from 3.5.27 to 3.5.29, now working, thanks!

@vishal4388

This comment has been minimized.

Show comment
Hide comment
@vishal4388

vishal4388 Jan 18, 2018

Thank you jazzedge. your code worked for me...

vishal4388 commented Jan 18, 2018

Thank you jazzedge. your code worked for me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment