Hi, I have implemented in nodejs 12 successfully a multistream skill on the basis of this project's implementation:
https://github.com/alexa/skill-sample-nodejs-audio-player
Now that I have got this skill running, I thought I experiment if I could get a background image added to the simpleCard. I designed and implemented APL by generating a json file from the APL UI and I have applied conditional code to distinguish between devices that have display and those that do not like this:
if(deviceHasDisplay(handlerInput)){
if (await canThrowCard(handlerInput)) {
const cardTitle = `Playing ${playlist.title}`;
const cardContent = `Playing ${playlist.title}`;
console.log(`device has display -- card title is ${playlist.title}`);
responseBuilder
.withSimpleCard(cardTitle, cardContent)
.addDirective({
type: 'Alexa.Presentation.APL.RenderDocument',
document: './prajna.json',
dataSources: {}
});
}
} else {
if (await canThrowCard(handlerInput)) {
const cardTitle = `Playing ${playlist.title}`;
console.log(`no display -- card title is ${playlist.title}`);
const cardContent = `Playing ${playlist.title}`;
responseBuilder.withSimpleCard(cardTitle, cardContent);
}
}
return responseBuilder.getResponse();
}
/** Check for a device with a display */
function deviceHasDisplay(handlerInput){
var result =
handlerInput &&
handlerInput.requestEnvelope &&
handlerInput.requestEnvelope.context &&
handlerInput.requestEnvelope.context.System &&
handlerInput.requestEnvelope.context.System.device &&
handlerInput.requestEnvelope.context.System.device.supportedInterfaces &&
handlerInput.requestEnvelope.context.System.device.supportedInterfaces.hasOwnProperty('Alexa.Presentation.APL');
return result;
}
Is this setup actually supported? I'd like to know before I get myself an Echo show to troubleshoot this. I understand that APL cannot be tested in the developer console, correct?