Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No intent gets called - "App Launch" does work #333

Closed
JustMeDaFaq opened this issue Apr 8, 2018 · 10 comments
Closed

No intent gets called - "App Launch" does work #333

JustMeDaFaq opened this issue Apr 8, 2018 · 10 comments
Labels

Comments

@JustMeDaFaq
Copy link

JustMeDaFaq commented Apr 8, 2018

Hi,
when using this interaction model:

{
    "interactionModel": {
        "languageModel": {
            "invocationName": "testintent",
            "intents": [
                {
                    "name": "AMAZON.CancelIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "samples": []
                },
                {
                    "name": "TestIntent",
                    "slots": [],
                    "samples": [
                        "tomato say me hello world"
                    ]
                }
            ],
            "types": []
        }
    }
}

calling "testintent" in amazons test console/alexa simulator correctly response with "You launched the app" (also console logs it), tho when then trying to invoke an intent by calling:
"tomato say me hello world" or "testintent tomato say me hello world", it seems that the endpoint does not get loaded/called actually. So, launching app works but intents doesnt, what am i doing wrong?

Using following nodejs code:

var express = require("express");
var alexa = require("alexa-app");
var app = express();
var http = require("http"),
    https = require("https")
var alexaApp = new alexa.app("test");



alexaApp.express({
  expressApp: app,
  checkCert: false,
  debug: true
});

// now POST calls to /test in express will be handled by the app.request() function

// from here on you can setup any other express routes or middlewares as normal
app.set("view engine", "ejs");

alexaApp.launch(function(request, response) {
  console.log("yay");
  response.say("You launched the app!");
});


alexaApp.intent("TestIntent", {
    "utterances": [
      "tomato say me hello world"
    ]
  },
  function(request, response) {
      console.log("suc");
    response.say("Success!");
  }
);


var fs = require("fs");
var privateKey  = fs.readFileSync("./cer/privkey.pem", "utf8");
var certificate = fs.readFileSync("./cer/cert.pem", "utf8");
var credentials = {key: privateKey, cert: certificate};

var httpsServer = https.createServer(credentials, app);
httpsServer.listen(443);

Does someone may know, what im doing wrong?

@kobim
Copy link
Contributor

kobim commented Apr 24, 2018

Hi @JustMeDaFaq,
Are you using the Alexa test simulator for testing?
Also, can you verify that your http server is running properly (and the certificate is valid) against the url you provided for your alexa skill?

@kobim kobim added the question label Apr 24, 2018
@JustMeDaFaq
Copy link
Author

Yeah, certificate gets called.
Using Alexa Test Simulator, the new one on the Homepage.

Writing testintent works, it triggers the 'you launched the app" stuff correctly. (alexaApp.launch)

Just not when using alexaApp.intent :)

@kobim
Copy link
Contributor

kobim commented Apr 25, 2018

If you are using the test simulator, can you take a look at the request it outputs in the Skill I/O tab?
Also, try to invoke ask testintent to tomato say me hello world as your command.

@JustMeDaFaq
Copy link
Author

ask testintent to tomato say me hello world => Works. How would i create a skill that just gets called by "tomato say me hello world " ?

@kobim
Copy link
Contributor

kobim commented Apr 28, 2018

You can read more about it at Invoking a Skill with a Specific Request , but I'm afraid the closest you will get is Alexa, say me hello world using tomato if your invocationName is tomato and your utterances include "say me hello world".

I'm pretty sure the usage of "connecting words" is there so Alexa could distinguish between different skills and route the request to the right one. If you want to elaborate on your use-case, we might be able to find the right utterance(s).

@kobim
Copy link
Contributor

kobim commented Oct 24, 2018

Good news! as Alexa's name-free interactions and skill discovery is in public beta, #378 will soon be merged and you will be able to resolve the issue you were having.

There's another issue (#367) with more links to developer documentation if you want to take a look.

@DeepakDonde
Copy link

DeepakDonde commented Nov 29, 2018

I am facing the same issue when using Alexa simulator.
But when I test with Manual JSON it works!!!!

I think nothing is wrong with your code.I will check on real Alexa device just to make sure that the problem is only with Alexa simulator.

Edit:I tried on alexa device but only App Launch is working.Intent calls are not delivered to webhook.

@FunnyDevs
Copy link

I have same problem, only app launch is working.

@DeepakDonde
Copy link

DeepakDonde commented Dec 6, 2018

I am able to resolve this issue. The problem is with maintaining the session.When launch request fires, You need to keep session alive.
shouldEndSession is the Boolean parameter which is used to maintain session.

Below link explains how it works:
https://developer.amazon.com/docs/gadget-skills/keep-session-open.html

@FunnyDevs
Copy link

now it works! Thank you

@dblock dblock closed this as completed Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants