question

Nikhil Wagh avatar image
Nikhil Wagh asked

How to test skill on devices without display?

With the launch of Alexa Presentation Language, the Skill Tester includes support for APL. Whenever I test my skill the JSON Input includes "Alexa.Presentation.APL" in "SupportedInterfaces". And this happens even if you disable Device Display.

Now because of this I'm unable to test my skill for Echo Dot (Devices without display).

So, How do I test my skill for devices without display?

alexa skills kitalexaalexa presentation language
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Gaetano@Amazon avatar image
Gaetano@Amazon answered

Hi,

which error are you getting when testing the skill on the Echo Dot? anyway you could check if your device has a display within you backend, and then let the skill behave differently according to that.

Here is the JS function to check it:

function supportsDisplay(handlerInput) {
    var hasDisplay =
      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
    console.log("Supported Interfaces are" + JSON.stringify(handlerInput.requestEnvelope.context.System.device.supportedInterfaces));
    return hasDisplay;
  }

this will return true if the device that is running your skill supports the display, alongside with logging all the other interfaces supported.

Please provide more info about the error, so we can help you further.

Kind regards,
Gaetano

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.