question

GlennL avatar image
GlennL asked

Go Home on cancel

Can someone help. I feel I have done cancel correctly but it doesn't exit the skill on devices with a screen.

It simply goes to the main screen on the app.

It should work the same way as

AMAZON.NavigateHomeIntent

Am I missing something in the below code?

const CancelAndStopIntentHandler = {
  canHandle(handlerInput) {
    return handlerInput.requestEnvelope.request.type === 'IntentRequest'
      && (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent'
        || handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent');
  },
  handle(handlerInput) {
    const speechText = 'Goodbye!';

    return handlerInput.responseBuilder
      .speak(speechText)
      .getResponse();
  },
};
alexa skills kitskillecho showaplalexa 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

GlennL avatar image
GlennL answered

Solved by adding the following to the return command

.withShouldEndSession(true)
10 |5000

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