I'm developing a new skill to Amazon Echo and I'm facing some problems when I need to get the clientContext to verify what is the Client ID of this Amazon Echo in the application.
Anyone know how it works correctly? Every time I receive undefined
value in context.clientContext
.
I made this process in Alexa developer panel:
1) Create a Skill as "Custom interaction Model"
2) Filled the Interaction Model correctly
3) Endpoint I linked with the Lambda Function
4) I've checked Yes
to "Do you allow users to create an account or link to an existing account with you?" question.
In lambda function I made it:
1) Used example "Colors" of the Alexa in Lambda
2) In the first line, I put the log to verify what the information is arriving.
Like this:
console.log("event.session.application.applicationId=" + event.session.application.applicationId);
console.log('clientContext =', context.clientContext);
console.log('context =', context);
The data is:
clientContext = undefined
{ callbackWaitsForEmptyEventLoop: [Getter/Setter], done: [Function], succeed: [Function], fail: [Function], logGroupName: '/aws/lambda/color', logStreamName: '2016/08/19/[$LATEST]7d66fec34f604692ad4c0bd1d138ae51', functionName: 'color', memoryLimitInMB: '128', functionVersion: '$LATEST', getRemainingTimeInMillis: [Function], invokeid: '14c606ef-6614-11e6-940d-cd0e175f3bda', awsRequestId: '14c606ef-6614-11e6-940d-cd0e175f3bda', invokedFunctionArn: 'arn:aws:lambda:us-east-1:...........86:function:color' }
I read in the Lambda documentation that it is possible for this value to be null
, but what is the reason for this value to be null?
Thanks a lot.