Keep session open

This commit is contained in:
Bilal
2018-01-08 21:13:23 +00:00
parent 1a9227e76d
commit 84c11f1b2f
2 changed files with 6 additions and 4 deletions

View File

@@ -8,8 +8,8 @@ config.REFRESH_TOKEN = 'Atzr|IwEBICA3kDhfSJxlwvnQp9AD1o115AC_KBbFd5GBg8oN_QHWn2o
config.TOKEN_EXPIRES_IN = 1515100500;
config.SKILL_ID = 'amzn1.ask.skill.efbf0564-a732-4ba9-958f-57939138adae';
//config.SKILL_DB_ID = '5a5016e775becaef2015da10'; //for server
config.SKILL_DB_ID = '5a232fb86ce046c749739455'; //for local
config.SKILL_DB_ID = '5a5016e775becaef2015da10'; //for server
//config.SKILL_DB_ID = '5a232fb86ce046c749739455'; //for local
config.CLIENT_ID = 'amzn1.application-oa2-client.c748ca56ded04a95b236979898585ff7';
config.CLIENT_SECRET = '6dea8125cecd049d3c4cff7bb5bdfd3ff17bc6fed246c4c8f6b519d9ed08d0b3';

View File

@@ -46,12 +46,12 @@ var updateIntentsJSON = function () {
utterances: intent.questions,
},
function (request, response) {
return response.say (intent.answer);
return response.say (intent.answer).shouldEndSession(false);
}
);
});
alexaApp.launch ((request, response) => {
return response.say (skill.invocationAnswer);
return response.say (skill.invocationAnswer).shouldEndSession(false);
});
})
.catch (err => {
@@ -94,10 +94,12 @@ router.post ('/updateSkill/:id', async (req, res, next) => {
let id = req.params.id;
let skill = req.body;
delete skill._id;
console.log('id = ' + id);
if (id !== '-1') {
amazonHelper
.updateSkill (skill)
.then (amazonResult => {
console.log('amazon result : ' + amazonResult);
if (amazonResult === 200 || amazonResult === 202) {
//Skill uploaded, it's ok to update databaseI
databaseHelper