Saturday, May 14, 2016

Add Some "Character" to Your Alexa Cards

Your Alexa skill can respond to a request with both a text string that the Echo will recite and some text that will display on a card in the Alexa app.  This card has very limited formatting options.  When the Alexa Skills Kit was initially announced, the only option was plain text on the Simple card.  You could include newlines, but in general, no other formatting.

Now there is an additional card type, the Standard type, that allows you to include an image.  However, in practice, there are a lot of restrictions for where the image can be hosted, the image format, and the image maximum file size.

An easy alternative way to make your card stand out is to include Unicode characters.  This technique works with all of the current card types.

Go to a website that shows the Unicode character that you want to use and copy the printable character.  Paste that into the text of your JSON response for your skill.  I use AWS Lambda to host my skill service and the Unicode character shows up in the online text editor.

When your skill sends the card to your Alexa app, it will display those characters inline with your text.  Here's an example of using the Unicode card suit characters in a skill I published:

Or how about adding some emoji's onto your card to personalize it... you can do that too!  Go to the Emoji Unicode Data website, and copy an emoji character from the Brow. column.  Paste that into your JSON response object.







Enjoy!

🤓

Additional details:

No comments:

Post a Comment