This is where we introduce APL, the Alexa Prersentation Language. In this module we create a simple splash screen APL document that we reuse across several intents. We also introduce Home Cards (these cards are typically visble in the Alexa app) and media storage via S3 in your Alexa Hosted Skill space to store the images we need to render. The APL document shows a tailored hint (thanks to the testToHint transformer)
- Build Tab: enable APL interface
- Code Tab: create documents folder. Go to S3 Media folder and add all image files in the project's documents/images
- Code Tab: in documents folder create launchScreen.json and leave empty
- Code Tab: add handlers.js file, move all handlers here, index.js becomes very small
- Display Tab: open APL authoring tool to explain the basics. Paste launchScreen.json as doc and launchSampleDatasource.json as datasource and explain/play with it.
- Code Tab: fill documents/launchScreen.json with result from APL authoring tool (better just copy paste the original)
- Code Tab: locate RemindBirthdayIntentHandler and add APL directive via util. Add standard card to response builder
- Code Tab: locate SayBirthdayIntentHandler and add APL directive via util. Add standard card to response builder
- Code Tab: locate CelebrityBirthdaysIntentHandler and add APL directive via util. Add standard card to response builder
- APL RenderDocument and APL Directive
- APL Databinding and APL Authoring Tool
- APL Styles, Layouts and ViewPorts
- APL Transformers (Text to Hint)
- Home Cards
- Media storage in Alexa-hosted Skills
- handlers.js: create file, put handlers here. For SayBirthdayIntentHandler, RemindBirthdayIntentHandler and CelebrityVirthdaysIntenteHandler: Add APL directive, use util.js APL helper and AHS url helper to pass background urls. Add card responses too.
- skill.json: insert APL interface definition for reference (not used in the project)
- util.js: insert supportsAPL() function
- documents: create folder and create inside launchScreen.json and launchSampleDatasource.json (for the APL authoring tool)
- constants.js: create APLDoc structure pointing to to launchScreen.json (for now)
- localisation.js: add strings for launch header and launch hint
- index.js: index is now shorter as it gets rid of the handlers