Alexa Nodejs sdk - What does withSimpleCard() do? - alexa

I am following the alexa nodejs sdk tutorial in amazon
The sample code has this line in all the responses -
.withSimpleCard('Hello World', speechText)
I checked the function definition file, it says :
Renders a simple card with the following title and content
Can some one please explain what this means ?
What is a card in alexa ?

Cards allow you to show visual content that complements Alexa's speech. For example the "Now Playing" card displays a song's name and playback controls. In your case it's just a simple text card.

Related

How not to display ssml tags on Alexa screen device while sending notification in Alexa

I have implemented Alexa Proactive events to send Notification
through Our skill in Alexa. It's working fine. But Problem is we
have added SSML tag say to speak as digits 2212545 like this to handle Audio. Rightnow this tag is displaying on screen of Alexa device. We don't want to display SSML tag. Please can anyone tell how can we remove these SSML tag in our Alexa notification while displaying
This is body i am sending
{"timestamp":"2021-02-23T07:06:00.693Z","referenceId":"db8b343f-5639-431c-a436-e7c6eee604c4","expiryTime":"2021-02-24T07:06:00.693Z","event":{"name":"AMAZON.MessageAlert.Activated","payload":{"state":{"status":"UNREAD"},"messageGroup":{"creator":{"name": "Amount 5000 for user id 2212545 will be credited on
2021/10/02"},"count":1}}},"relevantAudience":{"type":"Unicast","payload":{"user":
USER_ID}}}
I have a small library for formatting and such and just run my display text through a small regular expression.
I found this here and have used it ever since.
https://forums.developer.amazon.com/questions/5433/strip-ssml-tags-for-card-output.html
var regex = /(<([^>]+)>)/ig;
cardContent = someTextWithSSMLTags.replace(regex, "");

How to use an mp4 video stored on Dropbox within an Alexa Skill that uses an ALP document

My goal is to get an mp4 video i placed in dropbox to work within my Alexa Skill in which I am using an ALP document to include multimedia support. I am not interested in using Amazon S3 storage.
I was following a tutorial by dabbelab.
I could get their video to work: https://player.vimeo.com/external/373749691.hd.mp4?s=e43554c91fc796a20f051dcb8b45a74d035a6daa&profile_id=174
I could not get an mp4 video in my drop box to work:
https://www.dropbox.com/s/i8g0j8ghzprqyp3/Baby%20Cats%20-%20Cute%20and%20Funny%20Baby%20Cat%20Videos%20Compilation.mp4?dl=0
From what I can determine through Amazon's doc, I should be able to use any mp4 as long as I am using https. It is unclear to me what it is I am missing. Any advice greatly appreciated. Thank you.
First thing I'm seeing is the link. It ends with "dl=0." That link opens a dropbox page for playing the video, not the video itself.
Change that to "raw=1" and you should get the video itself like APL needs, not an HTML page.

Twitter summary card image is not always displayed

So i have a website which is builded with NextJS and i'm using Next SEO plugin for filling the meta tags necessary for twitter and facebook info...
I have card type option set to summart_large_image
<meta name="twitter:card" content="summary_large_image">
i can see that it's added to the website and it does work for some of the posts ... but something weird is happening , for example two of the tweets will have card with large image and then three of them would be just plain text with the link ...
I have a CMS in Silex where it's implemented automatic posting on twitter with twitter's API... and basicly i'm just posting a string with the link and some additional comment about it ... when i try do debugg with the twitter card validator it does work properly but not on my account ...
here's a screenshot for better explanation, the red ones are cards with large image and the blue ones have only text with link
All the posts have the same structure and equal size provided for the og:image tag.... all of them are equal basicly
Edit:
This is the twitter account in question for more clarity : https://twitter.com/someecards
Edit:
Now i even got a summary card with small image on a post which contains meta tag "summary_large_image" , and when i run the same link throught the link validator i'm getting the desired result
Link validator:
It looks like sometimes Twitter is not able to build the Card Preview (maybe a timeout when fetching the data or image) and, after that, the link is never accessed again, hence the preview is not rebuilt.
You can validate the preview with the Twitter Card Validation tool but it will probably work and show the correct link.
I have explained how the Card Preview works and limitation in a blog post, and created a tool to work around it.
In your case I would make sure the page is built before you post it onto Twitter, to make sure it is ready and served with minimum delay when the Twitter bot access it to generate the preview.

Alexa not showing card, despite being present in JSON

I'm trying to add cards to my skill, but have hit a weird snag. I can get cards to show up fine with a LaunchReqest, but the minute it hits an intent request, the cards stop showing.
The code for showing the card is the same as the code for the LaunchRequest:
return handlerInput.getResponseBuilder()
.withSpeech(speechText)
.withSimpleCard("HelloWorld", speechText)
.withReprompt(speechText)
.build();
Literally just a simple response with a Card I'm trying to get to show. This appears in the JSON that Alexa gets:
(Amazon doesn't let you copy from the console.)
This is in the dev console, my best guess currently is it is just a dev console bug, and not a real bug, but we haven't yet tested on a real device with the companion app, so I could be wrong.
Any direction here would be helpful, from all my reading online this should work, especailly since the same text works in a LaunchReqest, but not in an IntentRequest.
Cards are shown in companion Alexa Apps of the skill users. The response JSON you have shared looks good and cards should be displayed. Try logging into mobile app with your developer.amazon.com credentials and check the whether the cards are displayed. (Cards are displayed in the home section of Alexa app). If you don't have an Alexa app, you can use the web version at alexa.amazon.com
The cards are stuck in Alexa Test Console. It looks like the first card that is shown remains there forever. It's not getting refreshed.
BTW you can copy JSON from Alexa Test Console 😉

How to include more than one images in Alexa card

I am working on an Alexa Skill and would like to response a Standard Card with images. Amazon said that only one image can be included in a card, but it seems that AccuWeather.com can have more than one images in a card.
image of AccuWeather.com here
For the larger weather icon on the upper part of the card, it seems using the pre-defined smallImageUrl/ largeImageUrl. How about the smaller weather icons at the bottom of the card? Does anyone know how to do that?
I believe that this image is of the built-in Alexa whether skill rather than a skill from accuweather.com. Amazon's Alexa Skill API doesn't allow for more than one image in third-party skills, unfortunately.

Resources