Showing posts with label Lambda. Show all posts
Showing posts with label Lambda. Show all posts

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:

Friday, May 13, 2016

Last Thing to Do Before Publishing An Alexa Skill Hosted In Lambda

If you develop a skill for Amazon'z Echo and use the AWS Lambda service to host your skill, there is something you should do before you submit your skill for certification.

Publish a New Version and update your skill to use that version.

You'll notice that the ARN changes for this new version.  This is the ARN that you'll want to update your Skill to use.  The reason that you should use this version, is because it is Read-Only and matches the code that you've spent all the time developing and debugging.

I also suggest giving this version an alias.  You'll notice that assigning an alias also changes the ARN, so I recommend using that alias ARN in your skill.

The main reason for a versioned ARN is to make it easier to work on the next version, without accidentally breaking your current live version.

You may notice that if you find a bug after you publish your skill this way, there is no way to change that code since it is in a read only version.  You can only update the $LATEST version.  But that isn't the one that your Alexa skill is referencing.  But, if you aliased your version and pointed your skill to use the alias named ARN, then you can:
  1. Publish a new version of the fixed $LATEST code
  2. Remove the alias from the old version
  3. Assign the new version that alias name
  4. Set the Event Source to Alexa Skills Kit (that setting doesn't seem to copy with new versions/aliases)
Now your skill is referencing the new bug-fixed version.