Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save germanviscuso/97661963f0f5d6b9219b30fad714d2db to your computer and use it in GitHub Desktop.
Save germanviscuso/97661963f0f5d6b9219b30fad714d2db to your computer and use it in GitHub Desktop.
function supportsDisplay(handlerInput) {
// returns true if the skill is running on a device with a display (Echo Show, Echo Spot, etc.)
// Enable your skill for display as shown here: https://alexa.design/enabledisplay
return handlerInput.requestEnvelope.context &&
handlerInput.requestEnvelope.context.System &&
handlerInput.requestEnvelope.context.System.device &&
handlerInput.requestEnvelope.context.System.device.supportedInterfaces &&
handlerInput.requestEnvelope.context.System.device.supportedInterfaces.Display &&
handlerInput.requestEnvelope.context.System.device.supportedInterfaces.hasOwnProperty('Alexa.Presentation.APL');
}
function APLsupport(handlerInput) {
const Interface = handlerInput.requestEnvelope.context.System.device.supportedInterfaces;
return Interface['Alexa.Presentation.APL'];
}
if (!APLsupport(handlerInput)) {
return handlerInput.responseBuilder
.speak('APL no está soportado')
.getResponse();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment